Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Path part of pathname\\file

by esskar (Deacon)
on Mar 15, 2004 at 07:49 UTC ( #336624=note: print w/replies, xml ) Need Help??


in reply to Path part of pathname\\file

or doinig it on your own
my $path = "D:\\nt\\tools\\whoa.txt"; my ($pathname, $filename) = splitpath($path); print "$pathname => $filename\n"; sub splitpath { my ($path) = @_; my $pos = rindex($path, "\\"); return ("", "") if $pos < 0; my $filename = substr($path, $pos+1); my $pathname = substr($path, 0, $pos+1); return ($pathname, $filename); }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2023-03-28 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (66 votes). Check out past polls.

    Notices?