"be consistent" | |
PerlMonks |
Re: Re: Daft Regexpby jsprat (Curate) |
on Aug 05, 2003 at 01:21 UTC ( [id://280855]=note: print w/replies, xml ) | Need Help?? |
The problem is not the regex. Take a look at the values of $newname and $newdirname and the error messages. Look at the ouptut after adding rename ... or die "Error renaming $newname: $!"; #use $newdirname where appropriate to each rename statement. Since you are renaming _every_ file and directory, the whole rename sequence is practically begging to be taken out of the if/elsif statement. PS: You probably want to take a look at File::Find
In Section
Seekers of Perl Wisdom
|
|