use File::Copy; my @files=<*.dat>; foreach my $file (@files){ open FILE, "<$file" or die "Error $!"; my $fn; while(<FILE>){ last if ($fn)=$line=~/0 Name: (\w+\.\w+)/; } close FILE; move($file, $fn) if $fn and $fn ne $file; }
In reply to Re: Trying to get something done
by Banky
in thread Selectively renaming files
by Adrick
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |