Path: utzoo!censor!geac!torsqnt!hybrid!scifi!bywater!uunet!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: null? or not null? Message-ID: <1991Jan22.103609.27559@convex.com> Date: 22 Jan 91 10:36:09 GMT References: <1991Jan22.011051.24363@NCoast.ORG> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 48 Nntp-Posting-Host: pixel.convex.com From the keyboard of allbery@ncoast.ORG (Brandon S. Allbery KB8JRR): :As quoted from by rm55+@andrew.cmu.edu (Rudolph T. Maceyko): :| Doesn't PERL distinguish undefined variables from those whose values are :| "undef?" If so, an element of an array slice should have the value of the :| requested element if it has one (could be undef), or remain undefined. :+--------------- : :No, "undef" means the undefined state. Yes, Brandon's right, although bear in mind that if you do this: $foo{'bar'} = undef; You now have a key ('bar') that will show up if you pull the keys from %foo. Merely its value is undefined. :+--------------- :| print $], "\n"; :| print(($a,$b,$c) + 0, "\n"); :| $b = 1; :| print(($a,$b,$c) + 0, "\n"); :| $c = 1; :| print(($a,$b,$c) + 0, "\n"); :| :| prints :| :| $Header: perly.c,v 3.0.1.9 90/11/10 01:53:26 lwall Locked $ :| Patch level: 41 :| :| 0 :| 0 :| 1 :+--------------- : :Got me there; I'm not *that* much of a Perl guru. (I may be mis-interpreting the question, but here's a shot.) There are no arrays in the preceding statements, because you've added a 0 to your ($a,$b,$c) list, coercing a scalar context, so you no longer have list contruction, but rather simply the comma operator. So you take the last value in the list. --tom -- "Hey, did you hear Stallman has replaced /vmunix with /vmunix.el? Now he can finally have the whole O/S built-in to his editor like he always wanted!" --me (Tom Christiansen )