Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Path part of pathname\\file

by z3d (Scribe)
on Mar 15, 2004 at 12:21 UTC ( #336686=note: print w/replies, xml ) Need Help??


in reply to Path part of pathname\\file

Naivete shining through this morning, but if you can already pull out the file name, why not just get the pathname from what remains? (assuming you are trying to keep your exposure to modules and classes at a minimum ;). For instance, $path =~ s/$file$//;, though ugly and probably incredibly poor coding (I freely admit) is just as quick I would think at this point (assuming $path is your original path w/file name, and $file is your pulled out filename).



"I have never written bad code. There are merely unanticipated features."

Log In?
Username:
Password:

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

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






    Results (59 votes). Check out past polls.

    Notices?