in reply to Re: Combining s///
in thread Combining s///

More importantly, did you know you can have the substitute expression treated as Perl code using the e modifier?
for (@ARGV) { s! (\d{2})/ (\d{2})/ (\d{2}) ! my $y = ( $3 > 55 ? '19' : '20' ) . $3; "$y/$1/$2" !xeg; print "$_\n"; }

More tips:

Replies are listed 'Best First'.
Re^3: Combining s///
by starbolin (Hermit) on Mar 10, 2008 at 07:03 UTC

    I didn't know about the 'e' modifier. That would have saved a me a lot of time. Thanks ikegami.

    PS: $d stood in for 'date' and was going to be verbosed later, but later, as is it's want, never showed up.


    s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}