Last active
February 17, 2016 05:39
-
-
Save aereal/8218a07b6d229b0e18a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
package p { | |
sub f { | |
if (1) { | |
warn 'if'; | |
last; | |
warn 'unreachable?'; | |
} | |
} | |
} | |
my $method = 'f'; | |
my $pkg = 'p'; | |
$pkg->$method(); | |
# if at pl.pl line 9. | |
# Exiting subroutine via last at pl.pl line 10. | |
# Can't "last" outside a loop block at pl.pl line 10. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment