http://www.perlmonks.org?node_id=742421


in reply to Re^3: updating a variable call in a hash table
in thread updating a variable call in a hash table

No need for eval.

$sentence = sub { "The next color is ". shift }; $color = q(blue); print $sentence->($color);