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.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
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 |
In Section
Seekers of Perl Wisdom