Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
[shmem]: welcome back, canary!

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-02-21 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (288 votes). Check out past polls.

    Notices?