Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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";

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 scrutinizing the Monastery: (5)
As of 2016-10-25 23:43 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (330 votes). Check out past polls.