in reply to Using references to subroutines
You're missing some semi-colons:
my $subref = $tests; # Right here $testsub = sub { print $_; }; # And here
You're assigning the anon sub to a variable, so the statement is being parsed as an expression that happens to contain a subroutine, not as a subroutine on its own.
----
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
|
|---|