The Perl equivalent to DOS's %0 is $0 (both having derived from $0 in Unix shells). But "$0/../legal.txt" doesn't work on most operating systems. However, if you know you'll only be running under Win32, then you can actually just use that (or replace the "/"s with "\\"s).
If you want your code to be portable to other operating systems then to strip the script name from $0 you should use the File::Spec module or, if you need to work with even slightly old versions of Perl, use the File::Basename module.
- tye (but my friends call me "Tye")In reply to (tye)Re: DOS's %0\..\ Perl Equivalent
by tye
in thread DOS's %0\..\ Perl Equivalent
by davemabe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |