It's not even a week into 2007 and I'm already a big dumbass. I have a little utility that cleans up a bunch of text files from the command line, and like a good little program it saves the original in a backup.
foreach my $file ( @ARGV ) { if( -d $file ) { warn "Skipping directory [$file]!\n"; } my $bak = "$file.bak"; rename( $file, $bak ); ... }
if( -d $file ) { warn "Skipping directory [$file]!\n"; next; }