/usr/share/doc/liberror-perl/examples/example.pl is in liberror-perl 0.17025-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | use lib '.';
use Error qw(:try);
@Error::Bad::ISA = qw(Error);
$Error::Debug = 1; # turn on verbose stacktrace
sub abc {
try {
try {
throw Error::Simple("a simple error");
}
catch Error::Simple with {
my $err = shift;
throw Error::Bad(-text => "some text");
}
except {
return {
Error::Simple => sub { warn "simple" }
}
}
otherwise {
1;
} finally {
warn "finally\n";
};
}
catch Error::Bad with {
1;
};
}
sub def {
unlink("not such file") or
record Error::Simple("unlink: $!", $!) and return;
1;
}
abc();
$x = prior Error;
print "--\n",$x->stacktrace;
unless(defined def()) {
$x = prior Error 'main';
print "--\n",0+$x,"\n",$x;
}
|