Regular Expression and Substituting

Regular Expression and Substituting

foreach ( @ARGV )

{

if ( /GMIF1.[0-9]{5}/i )

{

$currentname=$_;

tr/[A-Z]/[a-z]/;

s/(gmi)f1.([0-9]{5})/\1\2.txt/;

rename ($currentname, $_);

}

}

Previous slide Next slide Back to the first slide View Graphic Version