[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

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?
0
Asdf
Asked:
Asdf
1 Solution
 
Perl_DiverCommented:
use FindBin qw($Bin);
print $Bin;

http://perldoc.perl.org/FindBin.html
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now