Remove file extension from files using Perl

Following on from my post last week - Remove extension from files in bash.  I have followed this up with a Perl One liner.

perl -we 'for my $old (glob "*.txt") { (my $new = $old) =~ s/\.txt\z//; rename $old, $new or warn "$old -> $new: $!\n"; }'

I am always interested in feedback so please feel free to add any comments, or you can mail me  here.  If you would like to submit a quick tip  with full credit and links back to your site then also feel free to contact me.

Related Posts Plugin for WordPress, Blogger...

Remove file extension from files using Python

Move MySQL Database Files