home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7486 < prev    next >
Encoding:
Text File  |  1992-12-17  |  979 b   |  26 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!usc!howland.reston.ans.net!news.ans.net!fuat
  3. From: fuat@news.ans.net (Fuat C. Baran)
  4. Subject: array of file descriptors
  5. Sender: news@ans.net (News Administrator)
  6. Message-ID: <1992Dec17.171242.22639@ans.net>
  7. Date: Thu, 17 Dec 1992 17:12:42 GMT
  8. Organization: Advanced Network & Services, Inc.
  9. Lines: 15
  10.  
  11. Is there a way to store file descriptors (from an open()) in an array?
  12. I would like to open a set of files, store the open file descriptors
  13. in an associative array keyed by filename and be able to multiplex
  14. output to one of the files in a loop where for each line of output I'm
  15. given a filename.  I'd like to check if $filehandles{$filename} is
  16. defined and if not first open the file.
  17.  
  18. Thanks in advance.  Apologies if this is a FAQ.
  19.  
  20.                         --Fuat
  21.  
  22. -- 
  23. Advanced Network & Services, Inc.        fuat@ans.net
  24. 100 Clearbrook Road                914-789-5328
  25. Elmsford, NY 10523                914-789-5310 (Fax)
  26.