in reply to Problems with Contents of $0 when using ActiveState PerlApp

Here's another, somewhat ugly, solution that might work no matter how you created your exexcutable (perlapp, perl2exe, etc.).
sub GetPathAndExe { use File::Spec qw(rel2abs); my $pathandexe; my $exe; my $path; if($0 =~/\.exe$/) { $pathandexe = File::Spec->rel2abs($0); } else { $pathandexe = $0; } ($path,$exe) = $pathandexe =~ /^(.*?)\\([^\\]+)$/; return ($path,$exe); }