Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Help with Coding Style

by JavaFan (Canon)
on Dec 25, 2009 at 20:59 UTC ( [id://814376]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my ($self) = @_; # You should probably write:
    my ($self) = shift; # Option 1.
    my ($self) = $_[0]; # Option 2. The two options do a very similar thin
    +g, choose the one that suits you and make sure you understand what th
    +ey mean.
    
  2. or download this
    for (my $i = 1; $i <= $size; $i++) # This is OK, but it is C style, no
    +t Perl.
    
  3. or download this
    for my $i (1 .. $size) # This is more Perlish and more readable. It's 
    +a matter of taste.
    
  4. or download this
    $self->{allowed} = [undef, (1) x $size];
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-25 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found