Subject: | Varstring lookup for object methods broken |
Lookup for method calls via var strings are broken if you try to call an
none existant method. This can happen if you get an object where you
don't know the exact class type.
If I try to catch this error in an conditional context, eg. an if (see
Sample 2) it will also croak.
I've attached a diff with a possible bugfix.
Would be great if you can comment/fix this :)
Sample 1:
----------------
$htc->param(hash_ref => { blessed => $object });
<%= hash_ref.blessed.any_none_existant_method %>
Sample 2:
----------------
$htc->param(hash_ref => { blessed => $object });
<%IF hash_ref.blessed.any_none_existant_method %>
this will also croak
<%/IF%>
Subject: | Compiler.pm.diff |
252c252
< \$var = UNIVERSAL::can(\$var,'can') ? \$var->$p() : \$var->\{'$path'\};
---
> \$var = 'HASH' eq ref \$var ? \$var->\{'$path'\} : UNIVERSAL::can(\$var,'$p') ? \$var->$p() : undef;
295c295
< \$var = UNIVERSAL::can(\$var,'can') ? \$var->$p() : \$var->\{'$path'\};
---
> \$var = 'HASH' eq ref \$var ? \$var->\{'$path'\} : UNIVERSAL::can(\$var,'$p') ? \$var->$p() : undef;