Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 chilling in the Monastery: (6)
As of 2016-02-07 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (250 votes), past polls