toddfreed has asked for the wisdom of the Perl Monks concerning the following question:
I can call this fine using the following -sub subby(&\@\@) { my ($coderef, $listA, $listB) = @_; my @result; .. logic .. @result; }
However, if I try to call it like thismy @subset = subby { .. logic .. } @A, @B;
I get this ->my @subset = subby { .. logic .. } @A, grep { .. logic .. } @B;
This yields the same errorType of arg 3 to main::subby must be array (not grep iterator) at ./te +st line 36, near "@B;"
Any ideas on how to get around this?my @subset = subby { .. logic .. } @A, (grep { .. logic .. } @B);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "not grep iterator" error
by Fletch (Bishop) on Sep 09, 2009 at 20:11 UTC | |
|
Re: "not grep iterator" error
by NetWallah (Canon) on Sep 09, 2009 at 20:31 UTC | |
by toddfreed (Novice) on Sep 09, 2009 at 21:54 UTC | |
by ikegami (Patriarch) on Sep 09, 2009 at 22:11 UTC |