Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2016-12-05 15:16 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (87 votes). Check out past polls.