home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5327 < prev    next >
Encoding:
Text File  |  1992-08-14  |  1.2 KB  |  33 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!mach.cs.cmu.edu!jfriedl
  3. From: jfriedl+@cs.cmu.edu (Jeffrey Friedl)
  4. Subject: Defined behavior?
  5. Message-ID: <BszuD5.515.1@cs.cmu.edu>
  6. Sender: news@cs.cmu.edu (Usenet News System)
  7. Nntp-Posting-Host: ernst.mach.cs.cmu.edu
  8. Reply-To: jfriedl@cs.cmu.edu
  9. Organization: Carnegie Mellon / Omron Corporation
  10. Date: Fri, 14 Aug 1992 21:58:08 GMT
  11. Lines: 20
  12.  
  13. Excuse the pun, but is the following defined behavior?
  14.  
  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.  
  21. It seems that the odd usage of 'defined' (having more than one "argument")
  22. undefines the "arguments" (I'm guess they're not really arguments, but
  23. expressoins linked by the comma operator).
  24.  
  25. I stumbled across this due to some dyslexic typing on my part.
  26.  
  27. Thanks,
  28.     *jeff*
  29. -------------------------------------------------------------------------
  30. Jeffrey Eric Francis Friedl   jfriedl@cs.cmu.edu -or- jfriedl@omron.co.jp
  31. Omron Corporation, Section RZE, Shimokaiinji, Nagaokakyo Kyoto 617, Japan
  32. Visiting researcher to the Mach Project, Carnegie Mellon University
  33.