in reply to Re: Re: Bug with lists?
in thread Bug with lists?
empty agreed, so it should be undef no?I think this is where you are taking a leap of faith, and leaping in the wrong direction. {grin}
In fact, Perl hints the contrary in perldoc perldata:
So there, you're not getting 1,2,3,undef. Just 1,2,3. An extra embedded syntax-only comma was formerly illegal (I believe). I'm a bit surprised to see that it's now being nicely ignored, just as the trailing comma had been, but it's not totally inconsistent with the trailing-comma-ignored feature.You may have an optional comma before the closing parenthesis of a list literal, so that you can say: @foo = ( 1, 2, 3, );
Conclusion: no bug, although not precisely documented to work with embedded comma as well as trailing comma.
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Bug with lists?
by demerphq (Chancellor) on Feb 18, 2002 at 14:02 UTC | |
by tilly (Archbishop) on Feb 18, 2002 at 17:54 UTC | |
by demerphq (Chancellor) on Feb 19, 2002 at 09:11 UTC |
In Section
Seekers of Perl Wisdom