in reply to I don't understand this grep
The following code
sub channels_by_level { grep { $_[0]->level( $_[1] ) } $_[0]->channels + }
can be written more clear such as:
sub channels_by_level { my $self = shift; my $level = shift; return grep { $self->level( $level ) } $self->channels; }
Method $obj->channels_by_level($level) returns those channels which has level given in an argument.
The problem is that your object doesn't have channels. To understand why it doesn't more code need to be shown.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I don't understand this grep
by gone2015 (Deacon) on Nov 05, 2008 at 18:07 UTC | |
by ikegami (Patriarch) on Nov 05, 2008 at 18:50 UTC | |
by ccn (Vicar) on Nov 05, 2008 at 19:17 UTC | |
by gwhite (Friar) on Nov 05, 2008 at 19:25 UTC | |
by gwadej (Chaplain) on Nov 05, 2008 at 18:11 UTC | |
by jwkrahn (Abbot) on Nov 05, 2008 at 18:37 UTC | |
by massa (Hermit) on Nov 05, 2008 at 19:00 UTC | |
by gwhite (Friar) on Nov 05, 2008 at 19:21 UTC | |
by gwadej (Chaplain) on Nov 05, 2008 at 19:28 UTC |