Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Too much recursion

by mprentice (Sexton)
on Jun 27, 2013 at 15:46 UTC ( #1041039=note: print w/ replies, xml ) Need Help??


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 }


Comment on Re^3: Too much recursion
Download Code
Re^4: Too much recursion
by jrvd (Novice) on Jun 27, 2013 at 15:54 UTC

    Works exactly the way I need it! Thanks!

    jrvd

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-11-25 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (160 votes), past polls