Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: array help

by dpuu (Chaplain)
on Dec 14, 2002 at 00:10 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-23 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found