Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: array help

by dpuu (Chaplain)
on Dec 14, 2002 at 00:10 UTC ( #219784=note: print w/replies, xml ) Need Help??


in reply to array help

You question is a little unclear: Do you have one scaling factor, or one per element of the array. I think you are wanting 1 scale facter for the entire array. So you might try:
my @source = (1..10); my $scale = <>; # get user input my @result = map { $_ * $scale } @source; print "original: @source\n"; print "scaled by $scale: @result\n";
--Dave

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2022-08-13 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?