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.
In reply to Re: What is your Perl dialect?
by demerphq
in thread What is your Perl dialect?
by webfiend
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |