Possible Duplicate:
In Perl, how do I get the directory or path of the current executing code?
Not the current working directory,bu开发者_如何学运维t the directory that the source being interpreted is in.
In PHP it's the __DIR__
keyword, is there such a thing in Perl?
There are a few different sources for this. You can try $ENV{PWD}, or use the Cwd module:
use Cwd;
my $cwd = getcwd;
精彩评论