We call perl scripts from within a IBM tool. The way we do this is make a call to JAVA runtime process and run a perl command on the server, the java process returns the output/error of the PERL script. In our testing we found at times the java process just hangs. Looks like the PERL script doesnt throw any output or error and just quits?? code is below
=cut use strict; use warnings; my $infilename = $ARGV[0]; my $outfilename = $ARGV[1]; my $header = $ARGV[2]; my $readoffset = $ARGV[3]; my $readreccnt = $ARGV[4]; my $inreccnt = 0; my $outreccnt = 0; print "StartTime:"; print scalar localtime(time); open my $INFILE, '<', $infilename; seek $INFILE, $readoffset, 0; open my $OUTFILE, '>>', $outfilename; if ($artheader ne 'NOHDR'){ $artheader =~ tr/'^'/' '/; print $OUTFILE "$header\n"; $outreccnt++; } READLOOP: while (<$INFILE>){ $inreccnt++; if ($inreccnt > $readreccnt){ last READLOOP; } s/^HHH\.S.*//s; s/^EEE\.S.*//s; s/^0000\S{4}\s{2}//; print $OUTFILE $_; $outreccnt++; } close $INFILE; close $OUTFILE; print ",EndTime:"; print scalar localtime(time); print ",\n"; print "InFileName:"; print $infilename; print ",ReadOffset:"; print $readoffset; print ",ReadRecordCnt:"; print $readreccnt; print ",OutFileName:"; print $outfilename; print ",OutRecordCnt:"; print $outreccnt; print ",\n"; print "HeaderLen:"; print (length $artheader); print ",HeaderData:"; print $header; print ",\n";
earlier i had use autodie but then took it out. I am new to PERL, is there a case where a PERL script can just quit and not throw any. Should i use "use autodie"?

In reply to can PERL just quit? by gupr1980

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.