use Cwd qw(abs_path); my $script_path = abs_path((caller())[1]); print "$script_path\n";