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


in reply to Re^7: How can I call a Perl sub with an object from a sub name stored in a var?
in thread How can I call a Perl sub with an object from a sub name stored in a var?

> Any defined-but-non-coderef value is stringified

Correction: any "non-coderef value is stringified" , even undef is stringified to an empty string. ( It's just tricky to create a sub for an empty symbol. :)

DB<199> $obj = bless {},"tmp" DB<200> $tmp::{''} = sub { say "empty" } DB<201> $meth = undef DB<202> $obj->$meth empty DB<203>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery