Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Handling multiple output files simultaneously using arrays of filehandles and filenames

by AnomalousMonk (Archbishop)
on Jan 21, 2021 at 23:21 UTC ( [id://11127248]=note: print w/replies, xml ) Need Help??


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:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found