kentfredric (owner)

Revisions

gist: 213339 Download_button fork
public
Description:
Carp::Always makes backtraces SUCK more for some reason.
Public Clone URL: git://gist.github.com/213339.git
Embed All Files: show embed
lib/Foo.pm #
1
2
3
4
5
6
7
8
9
10
11
12
package Foo;
 
use utf8;
use Moose;
 
extends 'Catalyst';
__PACKAGE__->config( name => 'Foo' );
__PACKAGE__->setup();
 
 
1;
 
lib/Foo/Controller/Broken.pm #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package Foo::Controller::Broken;
 
use Moose;
extends 'Catalyst::Controller';
 
sub broken : Local : Args(0) {
  my ( $c ) = shift;
  # this is an intentional syntax error.
  $c->foo
 
  return 1;
}
 
 
1;
 
output with carp::always.txt #
1
2
perl t.pl
syntax error at t.pl line 8
output without Carp::Always #
1
2
3
4
5
6
syntax error at lib/Foo/Controller/Broken.pm line 13, near "->foo
 
  return"
BEGIN not safe after errors--compilation aborted at lib/Foo/Controller/Broken.pm line 14.
Compilation failed in require at /usr/lib64/perl5/vendor_perl/5.10.1/Catalyst/Utils.pm line 280.
Compilation failed in require at t.pl line 8.
t.pl #
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl
use strict;
use warnings;
 
use lib 'lib';
 
# Commenting this line out produces *Better* backtraces.
 
use Carp::Always;
 
# The error should not appear to come from here :/
require Foo;