http://qs1969.pair.com?node_id=336686


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."