2009/7/30 David Nicol <davidnicol@gmail.com>: >>> Forbid labels with keyword names >> >> Interesting. This "broke" one of my CPAN modules. Wonder how many >> others it will affect? > > > Why? I've always considered the fact that you can generally use > keywords as other things in Perl to be a good thing. > > $ perl -le 'goto: $x++ > 3 and die 1; print $x; goto goto' > 1 > goto must have label at -e line 1. This error is about the second goto. > $ perl -le 'goto: $x++ > 3 and die 1; print $x; goto "goto"' > 1 > 2 > 3 > 4 > 1 at -e line 1. > > it's already a synbtax error when it makes no sense. What's the harm? No it's not : $ perl -e 'goto print' Can't find label 1 at -e line 1.Thread Previous | Thread Next