Seems like you can do the same without a recursion:
Update: Add "print $fd $_" to preserve original behavior.
sub hostname{ print $fd $_; while (<$fh>){ if ($_ =~ /^hostname /){ print $fd $_; $tot++; next; }else{ $tot2++; } } $tot++; # keep initial increment }
In reply to Re^3: Too much recursion
by mprentice
in thread Too much recursion
by jrvd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |