Skip to content

Instantly share code, notes, and snippets.

@aereal
Last active February 17, 2016 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aereal/8218a07b6d229b0e18a6 to your computer and use it in GitHub Desktop.
Save aereal/8218a07b6d229b0e18a6 to your computer and use it in GitHub Desktop.
#!/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