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

Re: Re: Recursion, tree parsing.

by antirice (Priest)
on Apr 14, 2003 at 21:03 UTC ( [id://250418]=note: print w/replies, xml ) Need Help??


in reply to Re: Recursion, tree parsing.
in thread Recursion, tree parsing.

Hmm, his code seems perfectly right to me. Your code skips the case where the children array may have only 1 element.

@bing = ("1"); print scalar @bing," ",$#bing,$/; if ($#bing > 0) { # your conditional print "Would execute$/"; } else { print "Wouldn't execute$/"; } __END__ Results: 1 0 Wouldn't execute


antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-24 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found