in reply to anonymous vs named subroutines as closures

you'll find excellent descriptions when searching for "will not stay shared"

The essential problem is

a) named subs are only created once

b) but lexical closure variables are dynamic

One way to get around this is

*ask_monkey_about =sub { my $cst = shift; $usd{$cst}; };

and you get a named sub which is dynamically bound to its closure.

Cheers Rolf

( addicted to the Perl Programming Language)