Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^2: Macro in perl code?

by w-ber (Hermit)
on Oct 16, 2007 at 20:25 UTC ( #645276=note: print w/ replies, xml ) Need Help??

in reply to Re: Macro in perl code?
in thread Macro in perl code?

Actually, for some time I have used the following convention in object-oriented modules:

sub func { my $self = shift; my ($param1, $param2, ..., $paramn) = @_; # ... }

Motivation: you "slurp" the calling object, after which it is clearer which are actually parameters to the method.

(Sorry for OT.)

Update: changed "my func" to "sub func". Silly me.

print "Just Another Perl Adept\n";

Comment on Re^2: Macro in perl code?
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2015-11-28 15:45 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls