in reply to What is your Perl dialect?
I like to think that I speak a fairly 5.6 dialect of perl. :-) Some things that I do and dont do are
sub recurse_inorder { my $self=shift; my @inorder; my $sub; $sub=sub{ my $node=shift; $sub->($node->left) if $node->left; push @inorder,$node->value; $sub->($node->right) if $node->right; }; $sub->($self); # Added due to [dragonchild]s eagle eye return \@inorder; }
---
demerphq
• Update:
dragonchild noticed that I ommitted to call $sub so I added the missing line. Thanks dude.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: What is your Perl dialect?
by broquaint (Abbot) on Feb 14, 2003 at 14:26 UTC | |
by demerphq (Chancellor) on Feb 14, 2003 at 16:35 UTC | |
|
Re2: What is your Perl dialect?
by dragonchild (Archbishop) on Feb 14, 2003 at 17:36 UTC | |
by demerphq (Chancellor) on Feb 14, 2003 at 18:18 UTC |