home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!darwin.sura.net!news.Vanderbilt.Edu!vuse.vanderbilt.edu!drl
- From: drl@vuse.vanderbilt.edu (David R. Linn)
- Subject: Query - arrays of files
- Message-ID: <C0r02A.526@vuse.vanderbilt.edu>
- Originator: drl@jester
- Sender: news@vuse.vanderbilt.edu
- Nntp-Posting-Host: jester
- Organization: Vanderbilt University School of Engineering, Nashville, TN, USA
- Distribution: na
- Date: Tue, 12 Jan 1993 15:51:45 GMT
- Lines: 37
-
- I am having trouble attempting to use arrays of filehandles. Is this
- supported in perl? For more details, read on.
-
- I am now using perl to generate my named/DNS files. In an attempt for
- generality, I have added some #DNSInfo# comments to my host file that
- describe, among other things, which subnets of Vanderbilt's class B
- network belong to the School of Engineering. I scan the whole file:
- processing the #DNSInfo# comments, ignoring other comments and
- collecting host info for later processing.
-
- After the scan is complete, I know the number of subnet files for which
- I need to generate PTR resource records and I tried to create an array
- of file handles:
-
- # for now, I *know* @subnets == (100, 101, 102, 103)
- for $subnet (@subnets) {
- open($PTR[$subnet],">rev.$subnet");
- }
-
- I thought that this would given me an arry @PTR of file handles to my
- PTR RR files, one for each subnet. I planned to write the PTR RR for a
- given host with a statement like
-
- printf $PTR[$subnet] "%s\t\tPTR\t%s\n",
- $octet[3], "$canonical.$subdomian.$domain";
-
- This didn't work and further reading has convinced me that it shouldn't
- have. However, the idea of using an array of file handles is still
- appealing. The problem comes in generating the file handle names.
- Would any of you more-experienced folks care to suggest a way to do
- this (or to explain why this is a bad idea)?
-
- David
- --
- David R. Linn, System/Mail/News Manager | INET: drl@vuse.vanderbilt.edu
- Disclaimer: I speak only for myself | Phone: [+1] 615-343-6164
- "Some do, some don't and that's the way of the world."
-