in reply to DOS's %0\..\ Perl Equivalent
if ($0=~/^(.+)\/.*/) { $dir=$1; } else { $dir="."; }
I'm sure there is a File::* module that will return the path (opposite of Basename), but it's real easy to roll your own. Of course this method doesn't account for Windows reverse directory seperators; but I'll leave that implementation as a exercise to the reader.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: DOS's %0\..\ Perl Equivalent
by chipmunk (Parson) on Jan 19, 2001 at 23:38 UTC |