in reply to Re: Filename fixer
in thread Filename fixer

True, the new code is a lot better. I just threw it here because I had it, a little hack for my friend, and thought someone else might need it... However, I happen to like the $_ variable quite a lot, and try using it as much as possible. Therefore I would rather do:
foreach (<*>) { (my $new = lc) =~ s/ |%20/_/g; $new =~ s/%25//g; rename($_, $new) or warn "can't rename $_ to $new: $!\n"; }
Another thing is that I don't really like using the foreach $variable (@array) {} syntax... I rather use map $variable { } @array if I can't use the $_ variable.. But thanks anyway! spm.