home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5330 < prev    next >
Encoding:
Internet Message Format  |  1992-08-15  |  1.3 KB

  1. Path: sparky!uunet!wupost!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Defined behavior?
  5. Message-ID: <1992Aug15.184523.10204@netlabs.com>
  6. Date: 15 Aug 92 18:45:23 GMT
  7. References: <BszuD5.515.1@cs.cmu.edu>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 26
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. In article <BszuD5.515.1@cs.cmu.edu> jfriedl@cs.cmu.edu writes:
  14. : Excuse the pun, but is the following defined behavior?
  15. : The two-line program
  16. :     $foo = 1; defined($foo,$foo);
  17. :     print $foo;
  18. : when executed with 'perl -w' (v4.035)  produces
  19. :     Use of uninitialized variable at file line 2.
  20. : It seems that the odd usage of 'defined' (having more than one "argument")
  21. : undefines the "arguments" (I'm guess they're not really arguments, but
  22. : expressoins linked by the comma operator).
  23.  
  24. The code that analyzes lvalues is rather, um, ad hoc.  It's getting
  25. confused somehow and generating an assignment where the left side is
  26. the list ($foo,$foo) and the right side doesn't exist.
  27.  
  28. : I stumbled across this due to some dyslexic typing on my part.
  29.  
  30. More like "lysdexic", which if you don't mind a bit of Greek would
  31. mean that the right side is rotting away.  Appropriate...
  32.  
  33. Since that code is going to be revised for perl 5 anyway, I'm not gonna
  34. worry about it for the moment.
  35.  
  36. Larry
  37.