Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Template, sorting an array with only one member

by ysth (Canon)
on Oct 20, 2014 at 18:16 UTC ( #1104475=note: print w/replies, xml ) Need Help??


in reply to Re^2: Template, sorting an array with only one member
in thread Template, sorting an array with only one member

Have one/all return arrayrefs, not lists?
sub all { my $self = shift; return $self->{'objects'}; } sub one { my $self = shift; my $filter = shift; return [ grep { $_->{'value'} == $filter } @{$self->{'objects'}} ]; }

Replies are listed 'Best First'.
Re^4: Template, sorting an array with only one member
by FloydATC (Deacon) on Oct 20, 2014 at 18:32 UTC

    You're absolutely right, both of you... Damnit. Well, at least I'll be able to sleep tonight :-)

    -- FloydATC

    Time flies when you don't know what you're doing

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2019-11-14 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (76 votes). Check out past polls.

    Notices?