Ted,<br><br>Thank you for your reply.&nbsp; I will work on adding some debugging.<br><br>Thanks again,<br><br>Richard<br><b><i>Ted Zlatanov &lt;@lifelogs.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> On Tue, 8 Jan 2008 06:55:49 -0800 (PST) Richard Reina <richard@rushlogistics.com> wrote: <br><br>RR&gt; Progress, maybe.  I believe this script is hanging at the line push(@lines, $_) unless (/espf\[/); <br>RR&gt; I believe this because in cases when it hangs, if I do a Cntl-C I get:<br><br>RR&gt; Not a subroutine reference at ./file_delimiter.pl line 24, &lt;&gt; line3.<br><br>RR&gt; This is turning out to be a disruptive problem here.  Any help would be greatly appreciated.<br><br>RR&gt; #!/usr/bin/perl5 -w <br><br>RR&gt; use warnings;<br>RR&gt; use strict;<br><br>RR&gt; sub delimit {<br><br>RR&gt; my ($tos, $ccs, $rp, $sb, $body, $in_file) = @_;<br><br>RR&gt; if (defined $in_file) { #
 file submited <br><br>RR&gt; @ARGV = $in_file;<br><br>RR&gt; $body = "";  <br><br>RR&gt; while(&lt;&gt;) {<br><br>RR&gt; push(@lines, $_) unless (/espf\[/);  # hangs here sometimes<br><br>RR&gt; } # end of while<br><br>RR&gt; } # end of if    <br><br>RR&gt; } # end of sub<br><br>It's unlikely this is your script, since line 24 is at the end and<br>@lines is not declared, which wouldn't work under `use strict'.  Can you<br>please post your actual code that hangs?  Also try some debugging output<br>(or the Perl debugger with a watch).<br><br>FWIW, I'd write delimit() like this (untested):<br><br>sub delimit {<br> my ($tos, $ccs, $rp, $sb, $body, $in_file) = @_;<br><br> return unless defined $in_file;<br> open IN, '&lt;', $in_file or warn "Could not open $in_file: $!";<br> my @lines;<br><br> while (my $line = <IN>)<br> {<br>  next if $line =~ m/espf\[/;<br>  push(@lines, $line);<br> } <br>}<br><br>Note how the open() will tell you if it couldn't open the input file,<br>which
 could be one of your problems.  Anyhow, don't post broken code, no<br>one can help you fix it.<br><br>Ted<br>_______________________________________________<br>Chicago-talk mailing list<br>Chicago-talk@pm.org<br>http://mail.pm.org/mailman/listinfo/chicago-talk<br></IN></richard@rushlogistics.com></blockquote><br><BR><BR>Your beliefs become your thoughts.  Your thoughts become your words.  Your words become your actions.  Your actions become your habits.  Your habits become your values.  Your values become your destiny.  -- Mahatma Gandhi