my objective here is to get the drive which my perl script lies in,
If you inspect the built-in variable, $0 (that's zero not oh), it will tell you the full path of the current script including the drive. Eg:
print $0;; C:\Perl64\bin\p1.pl
So, my( $drive ) = $0 =~ m[^(.)]; will give you the drive letter directly.
In reply to Re: -e on windows giving error
by BrowserUk
in thread -e on windows giving error
by Rudolf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |