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

Good clue, that article, thanks. Overkill, making a function out of it I 'spose, but this seems to work Ok as a script and as an .exe, even if it 'overworks' in its module loading:
use File::Spec; use File::Basename; [...] sub GetProcInfo { my ($path, @args); if (defined $PerlApp::VERSION) { $path = PerlApp::exe(); } else { $path = File::Spec->rel2abs($0); } @args = fileparse($path,(".pl", ".exe")); return(@args); }
...and I know something like:
(@args) = File::Spec->splitpath( $proc_path );
could possibly be better still, except my regex is kinda bad and I can't work out how to split the type out of the file returned (I want to be able to use just the name and just the extension/type).

Thanks again for the help.

John