http://www.perlmonks.org?node_id=379791

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Can I create an exe file, where it could run my script the same way if I(WinXP) type c:/perl script.pl.

I want people to just click on icon.exe an run my script.

I tried using PAR but it wouldn't work.

So could I use a notepad and create an exe file that will run my interpreter on that script??? TQ

Replies are listed 'Best First'.
Re: exe for perl
by ccn (Vicar) on Aug 03, 2004 at 19:15 UTC

    You can easily create *.bat file from your perl script using pl2bat which shipped with ActiveState perl

Re: exe for perl
by gri6507 (Deacon) on Aug 03, 2004 at 19:16 UTC
    You should be able to create a batch file "foo.bat" which would contain
    c:\perl\bin\perl.exe c:\my\path\myscript.pl
Re: exe for perl
by waswas-fng (Curate) on Aug 04, 2004 at 01:50 UTC
    What happened when you tried to PAR (pp) it?

    -Waswas
Re: exe for perl
by gawatkins (Monsignor) on Aug 04, 2004 at 03:07 UTC

    As long as your extensions (.pl) are set to open with the perl executable, you can run a .pl file by clicking on it or a shortcut to it. If this is not set correctly, you can right click on a .pl file, select "Open With", then "Choose Program" to find the Perl executable.



    Thanks,
    GW
      and if you append .pl to the PATHEXT environment variable then you don't need to type the .pl extension.
      PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.pl;
Re: exe for perl
by davidj (Priest) on Aug 03, 2004 at 19:16 UTC
    You might want to take a look at perl2exe.

    davidj