Hello Monks,

I am seeking wisdom because the script below, which is called from another perl script that runs on various linux consoles here is behaving srange. Sometimes it hangs and sometimes it does not.

I believe this script is hanging at the line

push(@lines, $_) unless (/espf\[/);

I believe this because in cases when it hangs, if I do a Cntl-C I get:

Not a subroutine reference at ./file_delimiter.pl line 24, <> line3.
This is turning out to be a disruptive problem here. Any help would be greatly appreciated.
#!/usr/bin/perl5 -w use warnings; use strict; sub delimit { my ($tos, $ccs, $rp, $sb, $body, $in_file) = @_; if (defined $in_file) { # file submited @ARGV = $in_file; $body = ""; while(<>) { push(@lines, $_) unless (/espf\[/); # hangs here sometimes } # end of while } # end of if } # end of sub

In reply to @ARGV while (<>) hangs by gatorreina

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.