use strict; use warnings; while (<DATA>) { chomp; my @parts = split /\./; pop @parts; my $file_no_ext = join '.', @parts; print "file_no_ext = $file_no_ext\n"; } __DATA__ foo.bar.txt goo.doc boo.hoo.moo
prints:
file_no_ext = foo.bar file_no_ext = goo file_no_ext = boo.hoo
In reply to Re: Regex To Remove File Extension (split)
by toolic
in thread Regex To Remove File Extension
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |