perldrive-letter

How do I get the substed drive letter in Perl?


I need to get substed drive letter in Perl. Could anyone kindly help me? $ENV{SYSTEMDRIVE} does not work; it gives me real logical drive letter, not the substed one.


Solution

  •  perl -e 'use Cwd; print( substr(getcwd(),10,1 )) ' # prints 10th char.