Compiling Perl with PAR

A

anton.vandersteen

Hello Perl friends,

I am trying to compile a perl programme with :

ppm install PAR
ppm install Module-ScanDeps

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

to an ".exe" programme.

However when I run the executable "file.exe" there occur problem
because I use Tk.

Below you can see the original Perl programme:

#!perl/bin/perl -w
use Tk;
use Tk::Clock;

my $MW=MainWindow->new();


### --- Prevents Main Window Resizing
$MW->bind('<Configure>' => sub{
my $xe = $MW->XEvent;
$MW->maxsize($xe->w, $xe->h);
$MW->minsize($xe->w, $xe->h);
});



$MW->title("My Analog Clock");

$clock = $MW->Clock();

$clock->config(
useDigital => 1,
useAnalog => 1,
anaScale => 250,
handColor => 'Blue3',
secsColor => 'Yellow2',
tickColor => 'Orange',
);

$clock->pack();

MainLoop();


I am hoping that someone can help me.

The clock is a test. When this works I can solve a bigger problem.

Thanks in forehand.
 
J

John Bokma

Hello Perl friends,

I am trying to compile a perl programme with :

ppm install PAR

Then you can create an executable with the line:


to an ".exe" programme.

However when I run the executable "file.exe" there occur problem
because I use Tk.

And the problem is? I mean: do you get a warning?

Quite some time ago I used PAR with a project. PAR is quite smart with
finding which modules are needed, but sometimes you need to give it a hint
with "use modulename".
 
S

Sisyphus

Hello Perl friends,

I am trying to compile a perl programme with :

ppm install PAR

Then you can create an executable with the line:


to an ".exe" programme.

However when I run the executable "file.exe" there occur problem
because I use Tk.

You might specifically need to load Tk and/or Tk::Clock using the '-M'
switch (see perldoc pp). Something like:

pp -M Tk -M Tk::Clock -o script.exe script.pl

Not sure if you specify the '-M' switch the second time as I have done.

Cheers,
Rob
 

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

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top