File: 01throw.t

package info (click to toggle)
liberror-perl 0.17-1.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 196 kB
  • ctags: 63
  • sloc: perl: 1,056; makefile: 38
file content (25 lines) | stat: -rw-r--r-- 288 bytes parent folder | download | duplicates (10)
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";;