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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.