Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Code Logic

by Tyke (Pilgrim)
on Jul 26, 2001 at 18:02 UTC ( #99979=note: print w/ replies, xml ) Need Help??

in reply to Grouping output statements into one location during recursive operation

Is there any reason that traverse can't take a reference to your variable, for instance...

#!perl -w use strict; my $var; traverse($_, \$var) for @ARGV; print $var; sub traverse { my($node, $var)= @_; $$var .= $node . "\n"; traverse($node, $var) unless length $$var > 10; # to show it work recursively } __END__ varref a b c d a a a a a a b c d
(Sorry about the simplified traverse)

Comment on Re: Code Logic
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2014-07-30 14:00 GMT
Find Nodes?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:

    Results (234 votes), past polls