Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: I need perl coding standards

by siracusa (Friar)
on May 29, 2005 at 00:47 UTC ( [id://461433]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
            my $var = shift;                        # wrong
            my($var) = @_;                          # right
            sub foo { uc $_[0] }                    # OK
            my($var1, $var2) = (shift, shift);      # Um, no.
    
  2. or download this
    use Benchmark qw(cmpthese);
    
    ...
      x_copy1 => 'x_copy1(@args)',
      x_copy2 => 'x_copy2(@args)'
    });
    
  3. or download this
                 Rate x_copy2 x_copy1 x_shift
    x_copy2  609756/s      --    -18%    -45%
    x_copy1  746269/s     22%      --    -32%
    x_shift 1098901/s     80%     47%      --
    
  4. or download this
    use Benchmark qw(cmpthese);
    
    sub x_shift { my $a = shift }
    ...
    my @args = (1 .. 3);
    
    cmpthese(1000000, { x_shift => 'x_shift(@args)', x_copy => 'x_copy(@ar
    +gs)' });
    
  5. or download this
                 Rate  x_copy x_shift
    x_copy  1298701/s      --     -0%
    x_shift 1298701/s      0%      --
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-03-28 17:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found