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: Intermediate:
How to make a EXE of a PL with included refrences.

 



basanth
New User

Apr 8, 2010, 9:13 PM

Post #1 of 2 (570 views)
How to make a EXE of a PL with included refrences. Can't Post

Hello Gurus,

Here is a intresting scenario. Scripts named,

1.Driver.pl

2. Func1.pl

3. Func2.pl

Driver.Pl contains,

do 'func1.pl';

do 'func2.pl';

'some code here

Func1 and Func2 contain,

use switch;

use Data::Dumper;

use XMLParser::Simple;

'some code here.

My case,

There is a situation where i need to execute the perl script on machines which do not have perl installed. In broader terms lets say there is a request from a business team or analysts who simply work on marketing/product deployments to explain much to the client.Under these circumstances wherein the person is pretty apprehensive to install perl because he thinks it may upset something else. Now, we can argue endlessly on this convincing him to install but there is no point. So, I felt we should give just the exe and that should do the required tasks.

I searched, researched over the web only to find Perl2Exe. However that throws a error when i try to execute the driver.exe. It says "Undefined Subroutine &main:XML::Parser" and so forth. I tried all that they said, by inculding #Perl2exe_include..blah blah blah...but it still does not work.

I looked at PAR, PP, but i am unable to understand how to use it. Can anyone help me ?

Would also appreciate suggestions or any other methods available to achieve the above task.

thanks much,

Basanth


FishMonger
Veteran / Moderator

Apr 9, 2010, 5:27 AM

Post #2 of 2 (561 views)
Re: [basanth] How to make a EXE of a PL with included refrences. [In reply to] Can't Post

These 2 lines are going to be a problem.

Code
do 'func1.pl'; 

do 'func2.pl';


The best approach would be to make those into modules that are loaded with 'use' statements rather than 'do' statements. If the contents of those scripts are as their names imply, then a functional/procedural module style that exports the subs (as apposed to an OO module) would be the obvious approach.

Once you do that, then use the pp utility to make the .exe file.


Quote
pp -o driver.exe driver.pl


 
 


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

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