Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Falling through Perl 5.10 switch statement

by betterworld (Curate)
on Apr 09, 2007 at 02:03 UTC ( [id://608924]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Falling through Perl 5.10 switch statement
in thread Falling through Perl 5.10 switch statement

Thats because your trying to goto a block that looks like it would be optimized out of existance.
That sounds like a nice explanation; however, the following script panics with the same message if there is a "1" in the command line:
use feature qw(say switch); for my $data (@ARGV) { given($data) { when (1) { say 'one'; goto two; } when (2) { two: say 'two' ; } default { say 'something else'; } } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://608924]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-25 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found