in reply to -e on windows giving error
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: -e on windows giving error
by Rudolf (Pilgrim) on Nov 17, 2011 at 23:30 UTC | |
by BrowserUk (Patriarch) on Nov 18, 2011 at 00:47 UTC | |
by ikegami (Patriarch) on Nov 17, 2011 at 23:42 UTC | |
by BrowserUk (Patriarch) on Nov 17, 2011 at 23:55 UTC | |
by ikegami (Patriarch) on Nov 18, 2011 at 00:05 UTC |