Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Issue with pp compile

by fazedandconfused (Novice)
on Jan 22, 2013 at 14:09 UTC ( #1014666=perlquestion: print w/ replies, xml ) Need Help??
fazedandconfused has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've got a strange problem using pp to compile a Perl script to exe. If I use a small script it works no problem but my script is hanging at the first "Set up gcc environment - 3.4.5 (mingw-vista special r3)" message.

I'm running ActivePerl 5.14..3 Build 1404 and I've just installed PAR::Packer today.

My script looks like this,

#!/usr/bin/perl -w my $color; my $summary; my $statusmsg; use Data::Dumper; use strict; use warnings; use DateTime; use Win32::OLE; my $dt = DateTime->now; # Stores current date and time as datetime + object my $date = $dt->dmy; # Retrieves date as a string in 'dd-mm-yyyy' fo +rmat my $time = $dt->hms; # Retrieves time as a string in 'hh:mm:ss' form +at my $datetime = "$date $time"; # creates 'yyyy-mm-dd hh:mm:ss' string my $computer = "localhost"; my $WMI = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") + or die; my $diskQ = $WMI->ExecQuery("SELECT CurrentDiskQueueLength FROM Win32_ +PerfFormattedData_PerfDisk_LogicalDisk where Name = C:"); if ($diskQ > 10) { $color = "red"; $summary = "$datetime Current Disk Queue length for drive C: $ +diskQ"; $statusmsg = "&red Current Disk Queue length for Drive C: is > + 10\n\n"; } else { $color = "green"; $summary = "$datetime Current Disk Queue length for drive C: $ +diskQ"; $statusmsg = "&red Current Disk Queue length for Drive C: is < + 10\n\n"; } open (MYFILE, 'C:\Program Files\BBWin\tmp\diskQ.txt'); print MYFILE $color; print MYFILE $summary; print MYFILE $statusmsg; close (MYFILE);

I've syntax checked it with Perl -c and with Enginsite Perl Editor so I know I have all the modules installed so has anyone any ideas about why it might be hanging?

Comment on Issue with pp compile
Download Code
Re: Issue with pp compile
by fazedandconfused (Novice) on Jan 22, 2013 at 14:22 UTC
    Oops, it appears that waiting 15 minutes for it to do something wasn't enough. Shortly after psoting this question it actually completed. I've used Perl2exe in the past (our licence is for an old version and I'm trying to avoid paying again) and that was always much quicker.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1014666]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-09-22 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (189 votes), past polls