home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!decwrl!bu.edu!transfer!sw.stratus.com!csa
- From: csa@sw.stratus.com (Chris Arthur)
- Newsgroups: comp.lang.perl
- Subject: help!
- Message-ID: <6087@transfer.stratus.com>
- Date: 2 Sep 92 01:45:10 GMT
- Sender: usenet@transfer.stratus.com
- Organization: Stratus Computer, Inc.
- Lines: 34
-
- I'm having a problem getting things like %{$var} and ${$var}{$stuff}
- to work (I'm not sure what you would call that). When I run the
- following:
-
- $a = "x.c";
- ${$a} = "hello";
- @{$a} = (one, two, threeeee);
- %{$a} = (a, apple, b, banana, c, cherry);
- print defined (@{$a}) . "\n";
- print ${$a} . "\n";
- print ${$a}[2] . "\n";
- print ${$a}{"a"} . "\n";
- $dnt = $a;
- print ${$dnt}{"b"} . "\n";
- $dnt = "x.c";
- print ${$dnt}{"c"} . "\n";
-
- I expect to see:
-
- 1
- hello
- threeeee
- apple
- banana
- cherry
-
- but I get two blank lines instead of banana and cherry. Am I doing
- something wrong or silly, or is this a bug? (Maybe both. :-)
-
- chris
-
- --
- Interface copyrights and software patents will devastate the software
- industry. Join the LPF (mail to league@prep.ai.mit.edu for more info).
-