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