On Fri, Jan 25, 2002 at 11:31:13PM -0500, Melvin Smith wrote: > At 11:40 AM 1/25/2002 -0600, Jonathan Scott Duff wrote: > >On Fri, Jan 25, 2002 at 11:57:25AM +0100, Bart Lateur wrote: > >> On Mon, 21 Jan 2002 15:43:07 -0500, Damian Conway wrote: > >> > >> >What we're cleaning up is the ickiness of having things declared outside > >> >the braces be lexical to the braces. *That's* hard to explain to > >beginners. > >> > >> But it's handy. And that was, until now, what mattered with Perl. > > > >No, handiness still matters with Perl. It's just that the balance has > >tipped a wee bit towards the consistency/regularity/simplicity/whatever > >side of the scale. > > > >Besides no one has commented on Steve Fink's (I think it was him) idea > >to store the result of the most recently executed conditional in $?. I > >kinda like that idea myself. It makes mnemonic sense. > > I like the $? idea, and it could probably be optimized away.
Optimization reminds me of the one thing about $? that bugs me. if (foo) # evaluates foo in boolean context if ($x = foo) # evaluates foo in scalar context, ($x=foo) aka $x in boolean context Allowing $? would eliminate having any different behavior from boolean vs scalar context, and that seems like a potentially bad idea. (And I really don't like the idea of behavior changing based on the addition of a $? way down within the if block.)