Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Finding sum of numbers and storing it an Array

by hippo (Chancellor)
on Sep 21, 2020 at 09:45 UTC ( #11121990=note: print w/replies, xml ) Need Help??


in reply to Re^2: Finding sum of numbers and storing it an Array
in thread Finding sum of numbers and storing it an Array

You can replace the map with a simple for loop.

my @array; push @array, $_ / $totalSum for @nums;

🦛

Replies are listed 'Best First'.
Re^4: Finding sum of numbers and storing it an Array
by shabird (Sexton) on Sep 21, 2020 at 09:51 UTC

    Thank you so much!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11121990]
help
Chatterbox?
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: (6)
As of 2021-01-27 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?