in reply to Re: How to pass blocks to subroutines
in thread How to pass blocks to subroutines

Almost there. You just need to dereference $func.

Replace:

 return grep $func, @$arr_ref;

... with:

 return grep &$func, @$arr_ref;

($func is a reference, and so always true.)

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Replies are listed 'Best First'.
Re^3: How to pass blocks to subroutines
by neniro (Priest) on Jun 12, 2004 at 17:26 UTC
    Damn, thats an ugly error. Can't believe I missed it.
      When in danger, or in doubt, copy code verbatim, tweak it out.

      Sometimes, you need to just start over with some sorta working code, understand what it does, and go backwards to wards a goal of something you want working. :)

      Bart: God, Schmod. I want my monkey-man.