File: NoType.pm

package info (click to toggle)
libtrycatch-perl 1.003000-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 464 kB
  • sloc: perl: 2,590; ansic: 19; makefile: 15
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;