home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5669 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  1.0 KB

  1. Path: sparky!uunet!decwrl!bu.edu!transfer!sw.stratus.com!csa
  2. From: csa@sw.stratus.com (Chris Arthur)
  3. Newsgroups: comp.lang.perl
  4. Subject: help!
  5. Message-ID: <6087@transfer.stratus.com>
  6. Date: 2 Sep 92 01:45:10 GMT
  7. Sender: usenet@transfer.stratus.com
  8. Organization: Stratus Computer, Inc.
  9. Lines: 34
  10.  
  11. I'm having a problem getting things like %{$var} and ${$var}{$stuff}
  12. to work (I'm not sure what you would call that).  When I run the
  13. following:
  14.  
  15. $a = "x.c";
  16. ${$a} = "hello";
  17. @{$a} = (one, two, threeeee);
  18. %{$a} = (a, apple, b, banana, c, cherry);
  19. print defined (@{$a}) . "\n";
  20. print ${$a} . "\n";
  21. print ${$a}[2] . "\n";
  22. print ${$a}{"a"} . "\n";
  23. $dnt = $a;
  24. print ${$dnt}{"b"} . "\n";
  25. $dnt = "x.c";
  26. print ${$dnt}{"c"} . "\n";
  27.  
  28. I expect to see:
  29.  
  30. 1
  31. hello
  32. threeeee
  33. apple
  34. banana
  35. cherry
  36.  
  37. but I get two blank lines instead of banana and cherry.  Am I doing
  38. something wrong or silly, or is this a bug?  (Maybe both. :-)
  39.  
  40.                         chris
  41.  
  42. -- 
  43. Interface copyrights and software patents will devastate the software
  44. industry.  Join the LPF (mail to league@prep.ai.mit.edu for more info).
  45.