Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://99979]
help
Chatterbox?
[LanX]: see protwin situation
[QM]: Anything like a qualtoo?
[QM]: er, quatloo
[shmem]: ah, silly typo. protein :(

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2017-08-17 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (286 votes). Check out past polls.

    Notices?