Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Whats the average time taken to learn Perl?

by tobyink (Abbot)
on Dec 19, 2012 at 01:22 UTC ( #1009479=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Function to add a list of numbers together
    sub sum {
    ...
        }
        return $sum;
    }
    
  2. or download this
    use List::Util 'reduce';
    sub sum {
        my @numbers = @_;
        return reduce { $a + $b } @numbers;
    }
    
  3. or download this
    sub sum {
        my $sum;
        $sum += $_ for @_;
        return $sum;
    }
    
  4. or download this
    use List::Util 'sum';
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-08-21 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls