summaryrefslogtreecommitdiff
path: root/t/01throw.t
blob: a1bdba2938b4082fdfae3505f8b8e11ba8aea202 (plain)
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

use Error qw(:try);

print "1..4\n";

try {
    print "ok 1\n";
};


try {
    throw Error::Simple("ok 2\n",2);
    print "not ok 2\n";
}
catch Error::Simple with {
    my $err = shift;
    print "$err";
}
finally {
    print "ok 3\n";
};

$err = prior Error;

print "ok ",2+$err,"\n";;