CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
is there a way to compile perl to binary exe.

 



brian.hayes
User

Jan 22, 2000, 7:47 PM

Post #1 of 15 (1557 views)
is there a way to compile perl to binary exe. Can't Post

Hello again,

I have noticed that there is no compiler in perl to create static exe files. Like gcc or vb6, etc...

Is there a way to do this?

Brian Hayes


brian.hayes
User

Jan 22, 2000, 7:51 PM

Post #2 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

Almost forgot. Does perl take advantage of a smp system. More than one processor?


Borderline
Deleted

Jan 22, 2000, 11:30 PM

Post #3 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

There is no viable way to compile a Perl script into executable format.
There is one module that converts it to C code but it is (according to the auther) not great C code. The module is called B and is by Malcolm Beattie. It is currently in Alpha 2 state of developement. You can find it on CPAN.

I am not familar with Duel Processor ops at all. Sorry.

Scott


brian.hayes
User

Jan 23, 2000, 4:47 AM

Post #4 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

Found the answere to the SMP processor issue.

Perl needs to be recompiled. Perl creates a sytem dependant arch. directory under the main perl directory which contains the core build. I.E i686-Linux.

Please note I have not have any issues with perl when using the i386-linux build. "Single processor build" on my multiple processor system.


Brian Hayes.


Jasmine
Administrator / Moderator

Jan 26, 2000, 8:48 PM

Post #5 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

Brian,

Check out Perl2Exe. I've never tried it, but have seen a lot of ads for it in the Perl Journal Wink

Perl2Exe's site says:

Perl2Exe is a command line utility for converting perl scripts to executable files.
This allows you to create stand alone programs in perl that do not require the perl interpreter. You can also ship the executable file without having to ship your perl source code.

Perl2Exe can generate executables for Win32 and Unix target hosts.

Perl2Exe also allows you to create no-console programs using Tk.


It says that it supports Linux, SunOS, BSDOS, IRIX, HP-UX, AIX, and FreeBSD and ActivePerl.

If you do decide to use it, would you mind telling us how you like it?


brian.hayes
User

Jan 27, 2000, 4:54 AM

Post #6 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

Hello again,

Thanks for the lead I will check that one out. I also found some information on another way to compile perl code. It still is somewhat beta but ships with 5.005 perl.

B::Bytecode, B::C, and B:CC. These will produce code respectfully. B::C creates C code so that you can compile using a C compiler.

Perl.com says:
The standard release comes with a perlcc tool to help manage the back-end code generators.
Three different code generators are supported:

B::Bytecode -- Perl compiler's bytecode backend
B::C -- Perl compiler's C backend
B::CC -- Perl compiler's optimized C translation backend


Also, Perlcc tool that ships with 5.005. This one will compile the code for you and will give you the option to include the Lib files for stand alone exe's. I belive it replaces the perl2exe.

perl.com says:

'perlcc' is the frontend into the perl compiler.
Typing 'perlcc a.p' compiles the code inside a.p into a standalone executable,
and perlcc A.pm will compile into a shared object, A.so,
suitable for inclusion into a perl program via ``use A''.

Usage:

%prompt perlcc a.p b.p c.p -regex 's/\.p/\.exe'

# compiles into 'a.exe','b.exe','c.exe'.


I will do some more test with this and give more detailed feed back.


Thanks for the help.

Brian Hayes


brian.hayes
User

Jan 28, 2000, 8:27 PM

Post #7 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

Still working on this one. It seems that this is in VERY Beta.. Every time I try to compile I get:

"Error can't open !".

Did have luck on the B::C module..

Succesfully created and compiled some c code,
But seems to die on big code perl code. Ther again this could be user error.

Brian Hayes


Cure
User

Jan 31, 2000, 2:09 PM

Post #8 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

I have a win32 operating system..

I installed the Perl2Exe on my computer and it compiled my cgi program to a .exe file(stand-alone) and it worked...

p.s. larry Wall must be God..........


Cure
User

Jan 31, 2000, 2:14 PM

Post #9 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

brian.hayes i Got this error also "Error can't open !".

Solution-> you need to put your .cgi or .pl in the same directory as your Perl2Exe or tell Perl2Exe the path to your .cgi or .pl that your trying to compile.




brian.hayes
User

Jan 31, 2000, 6:10 PM

Post #10 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

Thanks for the help...I am using the ActiveState version of perl to attempt this before attempting on Linux.

ActiveSate version requires a download of the Dev kit to have the abilty to compile code. This was succesfull, except I now need to figure out how to get IIS to run the program instead of downloading it.

It is now called perlapp instead of perl2exe.

Thanks again,

Brian Hayes


brian.hayes
User

Jan 31, 2000, 6:48 PM

Post #11 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

Correction perlapp is bundled with Activestate perl dev kit. perl2exe is another company.


brian.hayes
User

Jan 31, 2000, 7:01 PM

Post #12 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

How to for ActiveStates devkit compiler for perl scripts. Please goto activestate.com and read the licence agreement.

First Copy the script to the bin directory and type:

C:\perl\bin\perl perlapp.pl -dependant yourscript.pl

Note -dependant will create an exe that is dependant on perl being installed. You must purchase a license for the compiler to create standalone apps using this.

Once created just copy the newly created yourscript.exe to your equivilant of a Apache cgi-bin directory and point your browser at it. Meaning create a virtual Directory from the Admin Snapin and set the execute(including script) on that directory.

The test that I used included CGI.pl and the LWP.pl bundle or LWP::UserAgent.pm.

TESTED SUCSESSFULLY! Good luck to all on this one.


Brian Hayes


Cure
User

Feb 1, 2000, 2:52 PM

Post #13 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

I also have activeperl and all I had to do to compile a perl script is the follwing:

1.Install perl2exe
2. go to your ms-dos prompt then go to the directory where you installed perl2exe, then type perl2exe and the path to the script you want to compile

I installed my perl2exe into a directory I created called perlexe

example(this what i do)
c:\perlexe\perl2exe cure.cgi

and it compiles my script just fine.


brian.hayes
User

Feb 1, 2000, 6:12 PM

Post #14 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

Thank you for that advice, I will test it soon.

Thanks again,

Brian Hayes


freelancer
Deleted

Nov 15, 2000, 1:18 PM

Post #15 of 15 (1557 views)
Re: is there a way to compile perl to binary exe. [In reply to] Can't Post

How can I decompile an .exe file made by Perl2exe into a .pl file?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives