Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: "Indirect" object syntax?

by jdporter (Paladin)
on Nov 23, 2015 at 15:14 UTC ( [id://1148399]=note: print w/replies, xml ) Need Help??


in reply to Re: "Indirect" object syntax?
in thread "Indirect" object syntax?

In Perl, print STDOUT "$foo\n"; can be understood as "verb indirect-object object", where STDOUT is the recipient of the print action, and "$foo" is the object being printed.

Except that that's wrong. "$foo" is not an object -- direct or otherwise.

Properly,

method $object @args;
is "indirect object syntax", in Perl lingo, and
$object->method( @args );
is "direct object syntax". Same object; only the syntax is different. And English grammar terminology doesn't really apply well.

And the fact that @larry decided in their infinite (ly mistaken) "wisdom" to coin a completely unnecessary and superfluous alternative term for object, namely "invocant", manifests their misunderstanding of what an object is, in object-oriented programming. For "invocant" means, quite simply, "caller". But in print $fh or $fh->print, $fh is not the caller, it is the receiver. It is the object, not the subject, of the action.

I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-16 23:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found