in reply to Re: Re: Re: Template Method contra passing subroutines to constructor.
in thread Template Method contra passing subroutines to constructor.
Hmm, in that case you might be constrained by your design, but it is still possible like this:
package Foo; sub filter { . . . } package Bar; my $obj = Baz->new( \&Foo::filter );
Admittedly, this could get hackish fast.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Template Method contra passing subroutines to constructor.
by perrin (Chancellor) on Jan 13, 2004 at 19:09 UTC |