C
Chris
So, if I call
Package->method(),
then the string "Package" will be the first item in @_ when inside the
method() sub.
If I call
$object->method(),
then $ will be the first item in @_ when inside the method() sub.
If I call Package::method(), @_ will be empty.
perldoc perlobj calls the first one a "class method", because it
expects the class name as the first argument, and the second one an
"instance method", because it expects an object reference as the first
argument. The third one I consider a "static method", because it
doesn't expect the first argument to be anything special.
How can an XSUB differentiate between those 3?
Package->method(),
then the string "Package" will be the first item in @_ when inside the
method() sub.
If I call
$object->method(),
then $ will be the first item in @_ when inside the method() sub.
If I call Package::method(), @_ will be empty.
perldoc perlobj calls the first one a "class method", because it
expects the class name as the first argument, and the second one an
"instance method", because it expects an object reference as the first
argument. The third one I consider a "static method", because it
doesn't expect the first argument to be anything special.
How can an XSUB differentiate between those 3?