in reply to Re^2: Cava Packager quick question
in thread Cava Packager quick question

Could you not set a registry entry with "perl script.pl" vs "script.exe" when you install your script? Another thing you might do is set the associations so that .pl files are opened with the perl interpreter (just say "script" and away you go). You could also place a batch file in the directory to launch whatever style you've installed (run startscript.bat).

I'm not really sure how $0 helps you there however... you'd have to run your application to populate $0 in the first place, and at that point you're already running the code so you must have found it. Chicken vs Egg.

Replies are listed 'Best First'.
Re^4: Cava Packager quick question
by rmflow (Beadle) on Mar 26, 2010 at 07:41 UTC
    in my script I have '--install' option and the code determines if we are .exe or .pl and then writes to Registry '$0' or 'wperl $0'

    Of course it is not a problem, but now it is less flexible because I had to define the application's name in configuration file.
      Of course it is not a problem, but now it is less flexible because I had to define the application's name in configuration file.

      1) If $0 is wrong, its a bug/deficiency in cava packager, submit a bug report

      2) usually registry entries are handled by installer programs

      3) This is a flexible workaround

      $ cat myregular.pl use MySuperApp; MySuperApp->run; $ cat mypackedapp.pl BEGIN { use Cava::Pack; $0 = $Cava::Pack::EXEPATH; } use MySuperApp; MySuperApp->run;