kentfredric (owner)

Revisions

gist: 213352 Download_button fork
public
Public Clone URL: git://gist.github.com/213352.git
Embed All Files: show embed
broken.pm #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package broken;
 
 
use strict;
use warnings;
 
sub broken {
  my ($c) = shift;
 
  # this is an intentional syntax error.
  $c->foo
 
  return 1;
}
 
1;
 
t2.pl #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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.
 
WMDs.pm #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;