in reply to Regex To Remove File Extension

This node was taken out by the NodeReaper on Dec 05, 2010 at 15:13 UTC
  • Comment on Reaped: Re: Regex To Remove File Extension

Replies are listed 'Best First'.
Re: Reaped: Re: Regex To Remove File Extension
by Anonymous Monk on Jun 09, 2014 at 21:49 UTC

    What about doing this:

    $filename =~ /(.*)\./; my $basename = $1;

    Since the regex above is greedy, it should capture everything up to the last period. It seems to work for me. Am I missing something?