Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-09-22 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (191 votes), past polls