Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: parse filenames

by CukiMnstr (Deacon)
on Apr 12, 2002 at 17:28 UTC ( #158632=note: print w/replies, xml ) Need Help??


in reply to Re: parse filenames
in thread parse filenames

just to be on the safe side (in case the suffix contains letters or is longer than 3 chars):
my $suffix = $file =~ m/\.(.+)$/;

hope it helps,

Replies are listed 'Best First'.
Re: Re: Re: parse filenames
by ehdonhon (Curate) on Apr 12, 2002 at 19:12 UTC

    Make sure the file doesn't have more than one dot..

    my ($suffix) = $file =~ m/([^\.]+)$/;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2020-02-17 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (70 votes). Check out past polls.

    Notices?