Nothing stopping you from doing that:
my $sub = sub { . . . }; my $obj1 = Foo->new( $sub ); my $obj2 = Foo->new( $sub );
----
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
In reply to Re: Re: Template Method contra passing subroutines to constructor.
by hardburn
in thread Template Method contra passing subroutines to constructor.
by zby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |