I am trying to compile using the line
perlapp -c -v -r -s=dupes.pl -f -e=fixdupes.exe

when I run the .exe, it does not perform the same as the dupes.pl file.

the script goes into the database, finds duplicate entries, deletes them and then reorders the sequence number. The dbconnection.pm is an object used to return a dbhandle to the script. the three @ARGV[] elements are the database, username and password.

use dbconnection; use strict; open ERRFILE, ">>c:\\dupeerr.txt"; print @ARGV[0],"\n"; print @ARGV[1],"\n"; print @ARGV[2],"\n"; my @tsid; my $dupecount; my @temparray = (); my $connection = new Dbconnection(@ARGV[0], @ARGV[1], @ARGV[2]); my $sth = $connection->connection->prepare("select travelersystemid, remarktypecd, min(remarkseqnbr),remarktext from remarks group by travelersystemid, remarktypecd, remarktext having count(*) > 1 order b +y travelersystemid, remarktypecd, remarktext")or die print ERRFILE $!; my $rc = $sth->execute or die print ERRFILE $!; while ( my $row = $sth->fetchrow_arrayref){ push @temparray, @{$row}; push @tsid, @{$row}[0]; } $dupecount = scalar @tsid; print "Found $dupecount sets of duplicate records.\n"; print ERRFILE "Found $dupecount sets of duplicate records.\n"; for ( my $i=0; $i < scalar @temparray; $i += 4 ) { $sth = $connection->connection->prepare('delete from remarks where travelersystemid = CONVERT(int,?) and remarktypecd = ? and remarktext = ? and remarkseqnbr > CONVERT(int,?)') or die prin +t ERRFILE $!; $sth->bind_param(1, @temparray[$i]); $sth->bind_param(2, @temparray[$i+1]); $sth->bind_param(3, @temparray[$i+3]); $sth->bind_param(4, @temparray[$i+2]); my $rc = $sth->execute or die print ERRFILE $!; } foreach my $item(@tsid){ my $type = undef; #reset var +iable my $seqcount = 1; #reset var +iable @temparray = (); #reset arr +ay $sth = $connection->connection->prepare("select travelersystemid, remarktypecd, remarkseqnbr, remarktext from rema +rks where travelersystemid = CONVERT(int, ?) order by remarktypecd, remarkseqnbr") or die print ERRFILE $!; #get query $sth->bind_param(1, $item); #bind placeholde +r my $rc = $sth->execute or die print ERRFILE $!; #execute q +uery while ( my $row = $sth->fetchrow_arrayref){ push @temparray, @{$row}; } $type = @temparray[1]; my $i; for ( $i = 0; $i < scalar @temparray; $i += 4 ) { if ( $type ne @temparray[$i+1] ) { $seqcount = 1; $type = @temparray[$i+1] } if ( $seqcount != @temparray[$i+2] ) { $sth = $connection->connection->prepare(" update remar +ks set remarkseqnbr = CONVERT(int,?) where travelersystem +id = CONVERT(int, ?) and remarktypecd = ? and remarktext = +? and remarkseqnbr = CONVERT(int, ?)") or die print ERRF +ILE $!; $sth->bind_param(1, $seqcount); $sth->bind_param(2, @temparray[$i]); $sth->bind_param(3, @temparray[$i+1]); $sth->bind_param(4, @temparray[$i+3]); $sth->bind_param(5, @temparray[$i+2]); my $rc = $sth->execute or die print ERRFILE $!; } $seqcount++; } } $connection->logout; close ERRFILE;

Does anyone have any experience with compiling using perlapp and can you explain why it runs as a .pl but not an .exe?

In reply to perlapp not compiling properly by fmogavero

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.