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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://183399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-03-28 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found