May 29, 2002, 9:40 AM
Post #1 of 3
I recently came across this syntax:
Crazy! Class method invocation with ->
This is just an example by the way, I don't know of a Xerox_Machine module in real life. Now, as is standard, inside Xerox_Machine.pm is the a bunch of code that is all preceded by a "package Xerox_Machine;". So assuming that Xerox_Machine is a properly written object-oriented module, you would need to create an object of that class to implement it's method's properly. Otherwise, you could run it's subs by saying:
It surprised me that Perl would allow you to replace an object on the left side of the dereference operator with a class name. I haven't seen any documentation on that.
I tested this out with some random modules and it works. Can anyone else verify? I'm running v5.6.1 Binary Build 626 from IndigoSTAR.