sub delimit { my ( $tos, $ccs, $rp, $sb, $body, $in_file ) = @_; my @lines; 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 #### open my $fh, '<', $in_file or die "Error: can not open file $in_file $!";