in reply to Regex To Remove File Extension
Just for the TIMTOWTDI, here's one using substr and rindex:
my $n = 'foo.bar.txt'; $n = substr $n, 0, rindex( $n, q{.} );
In my own code, I'd write s{ \. [^.]+ \z }{}xms
In Section
Seekers of Perl Wisdom
in reply to Regex To Remove File Extension
Just for the TIMTOWTDI, here's one using substr and rindex:
my $n = 'foo.bar.txt'; $n = substr $n, 0, rindex( $n, q{.} );
In my own code, I'd write s{ \. [^.]+ \z }{}xms