Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Path part of pathname\\file

by esskar (Deacon)
on Mar 15, 2004 at 07:49 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found