Compiling to exe


T

tamiry

Hi,
I'd like to compile perl script to exe (on Win2K).
I tried:

C:\Work\Perl>perlcc script.pl
C:\Program Files\Perl\bin\perlcc.bat: script.pl did not compile:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.


I tried installing perl on another computer, on C:\Perl (to avoid the
"program files" space problem), and got

Note (probably harmless): No library found for oldnames.lib
Note (probably harmless): No library found for kernel32.lib
Note (probably harmless): No library found for uuid.lib
Note (probably harmless): No library found for ws2_32.lib
Note (probably harmless): No library found for mpr.lib
Note (probably harmless): No library found for winmm.lib
Note (probably harmless): No library found for version.lib
Note (probably harmless): No library found for odbc32.lib
Note (probably harmless): No library found for odbccp32.lib
Note (probably harmless): No library found for msvcrt.lib
'cl' is not recognized as an internal or external command,
operable program or batch file.
'link' is not recognized as an internal or external command,
operable program or batch file.

now, the last too are the obstacle.

can any one help ? thanks
 
Ad

Advertisements

J

jl_post

tamiry said:
Hi,
I'd like to compile perl script to exe (on Win2K).
I tried:

C:\Work\Perl>perlcc script.pl


Dear Tamiry,

perlcc has some issues to work out, so it generally doesn't work all
too well. I recommend instead installing PAR.

If you're using ActiveState Perl, this should be easy to do:

In a DOS prompt, type the following:
ppm install PAR
ppm install Module-ScanDeps

Then you can create an executable with the line:
pp script.pl -o script.exe

I hope this helps, Tamiry.

-- Jean-Luc
 
T

tamiry

thanks,

It worked, but when I ran it from a dirfferent computer (with no
perl installed), I got
'perlglob' in not recognized as internal or external command

It probably have problem with the part I used:
Logs = <*.txt>

should I add anything to the commands you gave me?

PS
can you please tell me what is PAR and ehat have I installed
(or send me to the appropriate manpage) ?

thnak you JL
 
Ad

Advertisements

J

jl_post

tamiry said:
It worked, but when I ran it from a dirfferent
computer (with no perl installed), I got
'perlglob' in not recognized as internal or
external command

It probably have problem with the part I used:
Logs = <*.txt>

You are correct.
should I add anything to the commands you gave me?

When a glob() function is encountered in a Perl script, some
versions of ActiveState Perl will run the "perlglob.exe" executable
using the backtick operator. The perlglob.exe program is usually
installed in the Perl\bin directory, so if ActiveState ActivePerl was
never installed, chances are that the perlglob.exe executable doesn't
exist, causing the backtick operator (and the glob() function) to fail.
It will run perfectly on the machine that created the PAR executable
because perlglob.exe exists there.

I've encountered your problem before, and the way that I got around
this problem was to add the line:

use File::Glob ':glob';

and change all "glob" calls to "bsd_glob". After that, globbing worked
perfectly. (In your case, you want to change "<*.txt>" to
"bsd_glob('*.txt')" .)

I suppose another simple solution would be to just copy the
perlglob.exe executable into a directory included in the $PATH of the
other computer.

Be careful when you run Perl code that uses the backtick operator;
if the executable (that you're running inside backticks) doesn't exist
on the machine that you run the script on, the script certainly won't
function correctly.
PS
can you please tell me what is PAR and ehat have I
installed (or send me to the appropriate manpage) ?

Sure. Just type "perldoc PAR" at the DOS prompt. You should see
the documentation for PAR. (You may also want to try "perldoc pp".)

I hope this helps, Tamiry.

-- Jean-Luc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top