Created
October 19, 2009 13:21
-
-
Save kentfredric/213352 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
package broken; | |
use strict; | |
use warnings; | |
sub broken { | |
my ($c) = shift; | |
# this is an intentional syntax error. | |
$c->foo | |
return 1; | |
} | |
1; |
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/perl | |
use strict; | |
use warnings; | |
use Carp::Always; | |
require WMDs; | |
__END__ | |
With: | |
syntax error at t2.pl line 6 | |
Without: | |
syntax error at broken.pm line 13, near "->foo | |
return" | |
Compilation failed in require at WMDs.pm line 12. | |
Compilation failed in require at t2.pl line 6. |
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
package WMDs; | |
use strict; | |
use warnings; | |
# Plagurised from Catalyst::Util; | |
sub anarchy { | |
my $error; | |
{ | |
local $@; | |
eval { CORE::require('broken.pm') }; | |
$error = $@; | |
} | |
die $error if $error; | |
} | |
#sub import { | |
WMDs->anarchy(); | |
#} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment