Determining the path a file resides in

Say I run a perl script from the home directory like so:

perl /some/path/scriptname

How do I determine the "/some/path" from inside scriptname?
AsdfAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Perl_DiverConnect With a Mentor Commented:
use FindBin qw($Bin);
print $Bin;

http://perldoc.perl.org/FindBin.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.