home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!cs.utexas.edu!sdd.hp.com!spool.mu.edu!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!ames!sgi!wdl1!wdl39!mab
- From: mab@wdl39.wdl.loral.com (Mark A Biggar)
- Subject: Re: problem with on-the-fly names
- Message-ID: <1993Jan27.181856.12690@wdl.loral.com>
- Sender: news@wdl.loral.com
- Organization: Loral Western Development Labs
- References: <Jan.26.13.13.51.1993.13626@bakerst.rutgers.edu>
- Date: Wed, 27 Jan 1993 18:18:56 GMT
- Lines: 20
-
- In article <Jan.26.13.13.51.1993.13626@bakerst.rutgers.edu> steiner@bakerst.rutgers.edu (Dave Steiner) writes:
- >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?
-
- Sure just move the kes inside the eval like so:
-
- @o = eval "keys \%$pname";
-
- --
- Perl's Maternal Uncle
- Mark Biggar
- mab@wdl1.wdl.loral.com
-
-