Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Separating file names from path names

by kabel (Chaplain)
on Oct 09, 2002 at 14:47 UTC ( #203939=note: print w/ replies, xml ) Need Help??


in reply to Separating file names from path names

have a look at the package File::Basename.

C:\Perl Testskripte\580>perl use strict; use File::Basename; my $file = "c:\\asdf\\asdf\\asdf\\image.jpg"; print "dirname is [", dirname ($file), "]\n"; print "filename is [", basename ($file), "]\n"; ^D dirname is [c:\asdf\asdf\asdf] filename is [image.jpg] C:\Perl Testskripte\580>


Comment on Re: Separating file names from path names
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2015-07-02 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (30 votes), past polls