home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!tcsi.com!iat.holonet.net!news.cerf.net!usc!howland.reston.ans.net!paladin.american.edu!gatech!psuvax1!rutgers!igor.rutgers.edu!bakerst.rutgers.edu!steiner
- From: steiner@bakerst.rutgers.edu (Dave Steiner)
- Newsgroups: comp.lang.perl
- Subject: problem with on-the-fly names
- Message-ID: <Jan.26.13.13.51.1993.13626@bakerst.rutgers.edu>
- Date: 26 Jan 93 18:13:52 GMT
- Organization: Rutgers Univ., New Brunswick, N.J.
- Lines: 22
- Cc: steiner
-
-
- I'm using the following in a program:
-
- eval "\$$pname{$o} = $_";
-
- which works fine (I'm reading printcap-like entries and creating an
- assoc array for each printer with the various fields in the array).
-
- The problem is that I don't know what fields are in the array and want
- to do something like
-
- @o = keys eval "\%$pname";
-
- but the syntax for keys doesn't allow this! Is there some other way I
- can get all the entries in the assoc array?
-
- ds
- --
-
- Dave Steiner
- arpa: Steiner@BakerSt.Rutgers.Edu or Steiner@Rutgers.Edu
- uucp: ...{backbone site}!rutgers!bakerst.rutgers.edu!steiner
-