Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: my $x or my ($x)

by nmerriweather (Friar)
on Apr 05, 2006 at 19:11 UTC ( #541492=note: print w/replies, xml ) Need Help??


in reply to my $x or my ($x)

if you're declaring 1 variable, its convoluted and a mess to do
my ($x) my $x; my $y; my $z;
but if you're instantiating a bunch of items before an eval block / loop:
my ( $x , $y , $z ); my ( $x , $y , $z );
both look cleaner to read and have a slighty faster perfomance (though its really insignficant). you can bench to see.

also: if you're doing oop perl:
sub function{ my $self = @_; }
is bad form - what if an argument is missing/extra?
sub function{ my ($self) = @_; }
is better. because you might want
sub function{ my ($self , $arg1 , $arg2 ) = @_; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://541492]
help
Chatterbox?
[Discipulus]: marioroy can you expand that Niagara's fall history?
erix only sees fallen angels
erix if it weren't for bad luck, I'd have no luck at all
Discipulus Windiows the OS of native americans..
[karlgoethebier]: marioroy: Next step: Write the ultimate book. "Parallel Programming With Perl. Yet Another Missing Manual" ;-)
[marioroy]: karlgoethebier I do not do Racket ball anymore. That was from gym class long ago.
[karlgoethebier]: marioroy ;Men need a challenge
Lady_Aleena remembers winning dodgeball and wonders why parents who played it will not let their kids play it.
[marioroy]: Disciplus My wife and I went on vacation. At work, I was stuck polling SNMP from 20 million devices. It would hang at 80,000. On the mist boat, hear a voice to enable grace in the design that 10x and more performance awaits.
[Lady_Aleena]: Women need challenges too karlgoethebier. 8)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-05-29 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?