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.
In reply to Debugging PAR packaged programs by dirtdart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |