in reply to Re^2: Too much recursion
in thread Too much recursion
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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Too much recursion
by jrvd (Novice) on Jun 27, 2013 at 15:54 UTC |