Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^7: Use of "my" after Perl v5.14

by Anonymous Monk
on Sep 21, 2012 at 02:41 UTC ( #994799=note: print w/ replies, xml ) Need Help??

in reply to Re^6: Use of "my" after Perl v5.14
in thread Use of "my" after Perl v5.14

use v5.14; sub total { my $sum = 0; foreach (@_) { $sum += $_; } say "list @_\nsum is $sum"; $sum; } say "Enter a list of number to calculate sum :"; my @numList = split /[,\s]+/, <STDIN>; chomp @numList; @numList = grep length, @numList; my $total = total(@numList); say "Total : $total"; __END__ Enter a list of number to calculate sum : 10 12 20 list 10 12 20 sum is 42 Total : 42

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2016-06-24 22:04 GMT
Find Nodes?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...

    Results (322 votes). Check out past polls.