dirtdart has asked for the wisdom of the Perl Monks concerning the following question:
I am attempting to distribute a script to a number of Windows machines that may or may not have Perl installed on them by using the PAR::Packer module. More specifically, the pp application that comes with the module. The program initially reads a list of settings from a configuration file and then attempts to perform some checks on the machine based on these configuration settings. After debugging, I packaged the script and moved it and the configuration file to a test PC. The script ran perfectly, except that it did not read one of the configuration settings from the file. Since I couldn't seem to find any way to debug the PAR exe, I insatlled ActivePerl 5.8 on the machine and copied the script to the machine. Using perl -d, the script executed flawlessly, reading the configuration file just as it should. The PAR exe still would not work. The offending code is as follows:
my @configFiles = <.\\*.conf>; foreach(@configFiles) { open CONFIG_FILE, "<:via(File::BOM)", $_; while(<CONFIG_FILE>) { if(/^backup path\s*=/) { (undef, $backupPath) = split(/\s*=\s*/,$_); } elsif(/^activation code\s*=/) { (undef, $activationCode) = split(/\s*=\s*/,$_); print "activation code: $activationCode\n"; } elsif(/^directory\s*=/) { (undef, $searchDirectory) = split(/\s*=\s*/,$_); } elsif(/^file\s*=/) { (undef, $searchFilename) = split(/\s*=\s*/,$_); } elsif(/^failure pattern\s*=/) { my (undef, $pattern) = split(/\s*=\s*/,$_); push(@failurePatterns, $pattern); } elsif(/^warning pattern\s*=/) { my (undef, $pattern) = split(/\s*=\s*/,$_); push(@warningPatterns, $pattern); } elsif(/^file age\s*=/) { (undef, $fileAge) = split(/\s*=\s*/,$_); } elsif(/^date in file\s*=/) { (undef, $dateInFile) = split(/\s*=\s*/,$_); } elsif(/^start from\s*=/) { (undef, $startFrom) = split(/\s*=\s*/,$_); } elsif(/^stop line\s*=/) { (undef, $stopLine) = split(/\s*=\s*/,$_); } elsif(/^date pattern\s*=/) { (undef, $datePattern) = split(/\s*=\s*/,$_); } elsif(/^database\s*=/) { my (undef, $pattern) = split(/\s*=\s*/,$_); push(@dbList, $pattern); } } }
Specifically, the offending line is (apparently): } elsif(/^activation code\s*=/) {
I would like to know if there is any way to debug a PAR exe so that I can (hopefully) see what's going on that it doesn't find that specific setting. Barring that, I would welcome any suggestions as to why this particular bit of code isn't working.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Debugging PAR packaged programs
by Herkum (Parson) on Dec 09, 2008 at 14:50 UTC | |
by Zen (Deacon) on Dec 09, 2008 at 16:27 UTC | |
by webfiend (Vicar) on Dec 09, 2008 at 17:50 UTC | |
by Herkum (Parson) on Dec 09, 2008 at 18:46 UTC | |
by Zen (Deacon) on Dec 09, 2008 at 19:17 UTC | |
by GrandFather (Saint) on Dec 09, 2008 at 20:48 UTC | |
by Zen (Deacon) on Dec 09, 2008 at 20:53 UTC | |
by Tanktalus (Canon) on Dec 10, 2008 at 04:57 UTC | |
by GrandFather (Saint) on Dec 09, 2008 at 21:10 UTC | |
| |
|
Re: Debugging PAR packaged programs
by Bloodnok (Vicar) on Dec 09, 2008 at 14:16 UTC | |
|
Re: Debugging PAR packaged programs
by dirtdart (Beadle) on Dec 09, 2008 at 14:27 UTC | |
by wanna_code_perl (Friar) on Dec 09, 2008 at 17:34 UTC |