File: NoType.pm

package info (click to toggle)
libtrycatch-perl 1.003002-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 488 kB
  • ctags: 939
  • sloc: perl: 2,753; makefile: 23; ansic: 19
file content (27 lines) | stat: -rw-r--r-- 285 bytes parent folder | download | duplicates (4)
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
package NoType;

use strict;
use warnings;

#use Moose;
use TryCatch;

BEGIN { 
    package Error;
    sub new { bless {}, $_[0]}
    #use Moose;
}
my $t = Error->new;

sub error {
    die bless {}, 'Error';
}

try {
    error();
}
catch(Error $e) {
    print "Error catched\n";
}

1;