in reply to Operator overloading, nomethod, and Introspection
If nomethod doesn't implement a specified operator, that means an operator was used on the object, but the object doesn't support it. I'd expect perl to die in that case.
Here's an example of what happens on non-objects:
>perl -e "%hash++"; Can't modify hash dereference in postincrement (++) at -e line 1, near + "%hash++" Execution of -e aborted due to compilation errors.
Here's what would happen nomethod wasn't there:
>perl -le "$r=bless({},''); print $r; printf '%x', ($r+1)-1" main=HASH(0x1abefa0) 1abefa0
|
|---|