in reply to Problems with Contents of $0 when using ActiveState PerlApp
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); }
|
|---|