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

This is more likely an issue with PerlApp than perl in general. As such you may be more likely to get useful advice in Active's ASPN forums.

Interestingly enough, putting - perlapp $0 - into Google and pressing "I'm Feeling Lucky" brings you to this post in the ASPN forums about this very situation.

HTH

  • Comment on Re: Problems with Contents of $0 when using ActiveState PerlApp

Replies are listed 'Best First'.
Re^2: Problems with Contents of $0 when using ActiveState PerlApp
by ozboomer (Friar) on May 26, 2005 at 03:36 UTC
    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