New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$a = 1,,,,,,,,, #1099
Comments
From cook@sightpath.comPerl fails to reject this program: $a = 1,,,,,,,, The superfluous commas just seem to be ignored. The camel says these are wrong (so I'm told; p528?): print $a, if s/x/y/; Yet perl accepts them. Perl Info
|
From @TimToadycook@sightpath.com writes: It also fails to reject these: $a = (1,,,,,,,,) : The superfluous commas just seem to be ignored. Yes. This is a recursive consequence of the rule that any list can end So your example is parsing as all these sublists: ($a = 1),(),(),(),(),(),(),(),() which, after you interpolate all the null lists, is just the list ($a = 1) which is, of course, no different from $a = 1 : The camel says these are wrong (so I'm told; p528?): That's talking specifically about putting a comma between a filehandle : print $a, if s/x/y/; Why not? There are no filehandles there, as far as Perl is concerned. Actually, now that I think about it, you can't actually start a list print, next if s/x/y/ it would print $_ and then do a next, since next would not be considered But they may certainly end with one. And since a list that ends with Larry |
Migrated from rt.perl.org#2053 (status was 'resolved')
Searchable as RT2053$
The text was updated successfully, but these errors were encountered: