in reply to Re: runtime eval() and constants
in thread runtime eval() and constants
You can force its interpretation as a class name by saying Bar::->method (no, that doesn't call &Bar:: even if you go out of your way to define such an evilly named sub) or "Bar"->method.$ perl -we'sub Foo { "Bar" } Foo -> method' Can't locate object method "method" via package "Bar" (perhaps you for +got to load "Bar"?) at -e line 1.
In a module or in a program using other's modules, you should do this all the time. After all, your code may have done use Some::Module and established a contract with that module, but when you say Some::Module->classmethod you are implicitly making an assumtion about the module Some, which you have no arrangement with.
|
|---|