You may want to try it like this:
#!/usr/bin/perl -w use strict; my $dir="."; opendir CONCEPT, $dir || die "no such dir"; while (my $temp = readdir(CONCEPT)){ if ($temp =~ /^(A-\d+-\d+)/) { rename $temp, $1 or die "error $! renaming $temp to $1"; } } closedir CONCEPT;
In reply to Re: renaming files...
by lhoward
in thread renaming files...
by base_16
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |