in reply to detecting code referece

In general, you should avoid designing APIs that need to know.

What if $result is an object intended to be interpreted as a scalar (i.e. overloaded) that happens to really be a blessed code reference?

Replies are listed 'Best First'.
Re^2: detecting code referece
by chromatic (Archbishop) on Dec 17, 2007 at 19:02 UTC

    Even more surprising, what if $result is a blessed scalar with &{} overloaded?

    In general, in Perl, there's no foolproof way of knowing the operations you can perform on a reference without performing the operation.