in reply to Another The (split) answer
in thread Probably silly regex question / not so silly regex question
If you don't like reverse for some reason.my( $name, $ext ); { my @chunks = split/\./, $filename; $ext = pop @chunks; $name = join '.', @chunks; }
Actually I really liked gryng's answer... I was just trying to thing of another way to do it using split.
For them that like one-liners:
my( $ext, $name )=(@_=split/\./, $filename and pop @_, join '.', @_);
|
|---|