Ted,<br><br>Thank you for your reply. I will work on adding some debugging.<br><br>Thanks again,<br><br>Richard<br><b><i>Ted Zlatanov <@lifelogs.com></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> Progress, maybe. I believe this script is hanging at the line push(@lines, $_) unless (/espf\[/); <br>RR> I believe this because in cases when it hangs, if I do a Cntl-C I get:<br><br>RR> Not a subroutine reference at ./file_delimiter.pl line 24, <> line3.<br><br>RR> This is turning out to be a disruptive problem here. Any help would be greatly appreciated.<br><br>RR> #!/usr/bin/perl5 -w <br><br>RR> use warnings;<br>RR> use strict;<br><br>RR> sub delimit {<br><br>RR> my ($tos, $ccs, $rp, $sb, $body, $in_file) = @_;<br><br>RR> if (defined $in_file) { #
file submited <br><br>RR> @ARGV = $in_file;<br><br>RR> $body = ""; <br><br>RR> while(<>) {<br><br>RR> push(@lines, $_) unless (/espf\[/); # hangs here sometimes<br><br>RR> } # end of while<br><br>RR> } # end of if <br><br>RR> } # 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, '<', $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