[Gllug] perl script
Nick Mailer
nickm at positive-internet.com
Wed Aug 21 23:27:15 UTC 2002
On Wednesday 21 August 2002 7:41 pm, Chris Ball wrote:
> >> On Wed 21 Aug 2002 19:23:22, Nick Mailer <nickm at positive-internet.com>
said:
> >> 01_02_03_04.jpeg becomes 02_01_03_04.jpeg
>
> NM> { /^(.)(.)(.)(.)(.)(.*)$/; rename ($_, "$4$5$3$1$2$6"); }
>
> Yuck.
>
> { /^(\d{2})_(\d{2})_(.*)$/; rename ($_, "$2_$1_$3") or die; }
>
> - Chris.
He didn't specify the uniformity of the digits or the underscores. He merely
said that he wished the letters reversed. The only way to "optimise" mine,
bearing this in mind, is to use braces, but this actually obfuscates.
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list