indirect object

1 topic · 1 source

Technology› Programming

Perl

In English grammar, a short noun phrase between a verb and its direct object indicating the beneficiary or recipient of the action. In Perl, print STDOUT "$foo "; can be understood as "verb indirect-object object" where "STDOUT" is the recipient of the print action, and "$foo" is the object being printed. Similarly, when invoking a "method", you might place the invocant between the method and its arguments:

 $gollum = new Pathetic::Creature "Smeagol"; give $gollum "Fisssssh!"; give $gollum "Precious!";

Cite this definition

APA
MLA
Chicago