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.
In reply to Re: DOS's %0\..\ Perl Equivalent
by mr.nick
in thread DOS's %0\..\ Perl Equivalent
by davemabe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |