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;
|
|---|