Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Re^2: Help with Coding Style

by JavaFan (Canon)
on Dec 25, 2009 at 20:59 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2023-10-04 19:41 GMT
Find Nodes?
    Voting Booth?

    No recent polls found