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