Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: mutliplying each element of a list by the same number

by pc88mxer (Vicar)
on May 15, 2008 at 15:58 UTC ( [id://686766]=note: print w/replies, xml ) Need Help??


in reply to Re: mutliplying each element of a list by the same number
in thread mutliplying each element of a list by the same number

This is just slightly more efficient (at least in terms of keystrokes if not execution time):
for (@ratio_list) { $_ *= 10 }
If you wanted to simultaneously create @minutes_list, you can use:
for (@ratio_list) { ($_ *= 10) && push(@minutes_list, $_) }

Replies are listed 'Best First'.
Re^3: mutliplying each element of a list by the same number
by chromatic (Archbishop) on May 15, 2008 at 17:49 UTC
    for (@ratio_list) { $_ *= 10 }

    If you're going to do that, why not get rid of useless punctuation altogether?

    $_ *= 10 for @ratio_list;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-20 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found