Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: 20 most important Perl Best Practices

by aaron_baugher (Deacon)
on Aug 22, 2012 at 22:40 UTC ( #989163=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $x=3; $y=4; $z = 5;
    # or maybe better
    ($x, $y, $z) = (3, 4, 5);
    
  2. or download this
    if(match)
    {
        do_this();
    ...
    {
        do_that();
    }
    
  3. or download this
    if(match){
        do_this();
    } else {
        do_that();
    }
    
  4. or download this
    while(<DATA>){
      chomp;
    ...
      $line =~ s/foo/bar/g;
      say $line;
    }
    
  5. or download this
    do_this(), do_that if $match;
    
    do_this($_) for @items if $match;
    
  6. or download this
    do_this() unless $found;
    
    # surely you're not suggesting this is better, are you?
    
    do_this if not $found;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2014-08-20 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (114 votes), past polls