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

Re^5: How to store the output from foreach loop into variable/array without printing?

by hazylife (Monk)
on Mar 13, 2014 at 10:14 UTC ( [id://1078156]=note: print w/replies, xml ) Need Help??


in reply to Re^4: How to store the output from foreach loop into variable/array without printing?
in thread How to store the output from foreach loop into variable/array without printing?

Instead, it print out only the last column:
so I change to this line by adding the "." to join the 6 columns together and I get weird output like this:
You're not actually using the index variable ($index1). And you also need to properly re-initialize $variable1.

Would this do what you want?

my @ratio = map { sprintf '%.4f', $numerator[$_]/$denominator[$_] } 3. +.8; my $variable1 = join "\t", @ratio;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (None)
    As of 2024-04-25 00:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found