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

Re: Re: Extracting just the extension from a filename.

by moxliukas (Curate)
on Jul 19, 2002 at 19:25 UTC ( #183399=note: print w/replies, xml ) Need Help??


in reply to Re: Extracting just the extension from a filename.
in thread Extracting just the extension from a filename.

This would work OK, but if the extension would contain some `funny' characters you could get into problem. It is not very often that you get extensions with spaces and other weird things, but hey, you never know. So my solution would be:

my $filename = '20020719.csv'; $filename =~ /\.([^\.]*)$/; my $extension = $1;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://183399]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2017-09-26 17:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (296 votes). Check out past polls.

    Notices?