in reply to Re^6: 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?

Well, thats not what I had in mind :)

Can you describe/explain what this loop does in one sentence? Your explanation will help me write a response you can understand (hopefully)

for $arr_ref1 ( @full_data ) { for $arr_ref2 ( @full_data ) { } }
  • Comment on Re^7: How to store the output from foreach loop into variable/array without printing?
  • Download Code

Replies are listed 'Best First'.
Re^8: How to store the output from foreach loop into variable/array without printing?
by hellohello1 (Sexton) on Mar 14, 2014 at 06:19 UTC
    Oops. Ok. I store the data (column D onwards) into the array because I need to calculate the ratio between each rows. So I store into two arrays such that I can take 1st array/2nd array.
    _Input DATA_ A B C D E F G H M11 0.1 10 24 56 77 98 72 M12 0.3 13 44 23 45 56 11 M13 0.4 54 23 11 25 67 91
    Store values from D to H into $arr_ref1 ( @full_data ) and $arr_ref2 ( @full_data ) and divide from there:
    _INPUT DATA_ D E F G H 24 56 77 98 72 44 23 45 56 11 23 11 25 67 91 _OUTPUT DATA_ 1 1 1 1 1 1.83 0.41 0.58 0.57 0.15 0.95 0.19 0.32 0.68 1.26
    I hope my explanation is ok. :)

      I hope my explanation is ok. :)

      :) I wanted to hear something more basic, what you described is like a statement of goals

      Consider this loop

      for $one ( 1 .. 10 ){ for $two ( 1 .. 10 ){ } }

      Please can you describe what it does?

        Using nested for loop to compare all elements in the array to each other?