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
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 = (
Conclusion: no bug, although not precisely documented to work with embedded
comma as well as trailing comma.
-- Randal L. Schwartz, Perl hacker