Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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 imbibing at the Monastery: (3)
As of 2016-09-25 11:25 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (470 votes). Check out past polls.