in reply to Re^2: Handling multiple output files simultaneously using arrays of filehandles and filenames
in thread Handling multiple output files simultaneously using arrays of filehandles and filenames

... #Output line of matching data to output file for the relevant sector print $fh[$dataSector] "$mydata\n"; ...

So the syntax you need to use is
    print { $fh[$dataSector] } "$mydata\n";
(extra spacing around the curlies just for visibility/clarity).


Give a man a fish:  <%-{-{-{-<

  • Comment on Re^3: Handling multiple output files simultaneously using arrays of filehandles and filenames
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: Handling multiple output files simultaneously using arrays of filehandles and filenames
by Cosmic37 (Acolyte) on Jan 22, 2021 at 14:01 UTC
    Thanks again. I would like to confirm to you that this is indeed what I have done. Using curly braces allowed successful execution of the code. I also tried without the curly braces as a cross check of your correctness and I can confirm that the code failed in that case. Therefore I can confirm that on this occasion your advice was top notch! Spitze! Ausgezeichnet! Parfait! Fabuloso! Wunderbra!
      ... your advice was top notch! ... Wunderbra!

      I'm glad I've been able to provide so much support! :)


      Give a man a fish:  <%-{-{-{-<