That reads awkwardly, I find. This is how I'd write it:
sub getRef { my $self = shift; $_ = $self->getNodeById( $_ ) for grep { $_ and not ref } @_; return ref $_[0]; }
It maps more closely to the way I think of the problem. You can almost read it out in natural language: "filter it through $self->getNodeById() for every element that is true and not a reference".
Makeshifts last the longest.
In reply to Re: The trouble with Perl Idiom
by Aristotle
in thread The trouble with Perl Idiom
by demerphq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |