Open MLRiain opened 9 years ago
Perl::Critic does not work on syntactically invalid code. If it attempted to, it would have to take arbitrary input and attempt to do something with it, e.g. an MP3 file. ;]
"..." is a valid variation on "..". see perldoc perlop for details. E.g. in perl 5.6.2:
perl -wle 'for ( 1 ... 2 ) { print $_ }'
1
2
As I understand perlop
, both should produce the same result in list context. So would the policy be to prohibit ...
in list context (presumably because ..
is better known)?
I was the one who recommended the OP to post this. I've never seen ...
used in such context (and probably never in list context in general) and I think it should be discouraged. It is confusing. So what @thaljef said.
I am also sad to see @clonezone jumping the gun so quickly. That code was syntactically correct and did exactly the same as the ..
would have done.
I am also sad to see @clonezone jumping the gun so quickly
It just goes to show how obscure the ...
operator is. I would have made the same conclusion if @moregan hadn't spoken up.
Sorry, @szabgab, but the subject does say "syntax error", and I followed on from that.
Changed the issue name to something that does not include the words "syntax error".
@clonezone you are right. I have not noticed that the title says syntax error. Then I understand your comment.
Using three dots in a foreach range instead of two is passed over. Example: foreach my $item ( 0 ... $max ) instead of: foreach my $item ( 0 .. $max )