1#!/usr/bin/perl -w 2use strict; 3use Test::More 'no_plan'; 4use constant NO_SUCH_FILE => "this_file_had_better_not_exist"; 5 6eval { 7 use autodie qw(open open open); 8 open(my $fh, '<', NO_SUCH_FILE); 9}; 10 11isa_ok($@,q{autodie::exception}); 12ok($@->matches('open'),"Exception from open"); 13 14eval { 15 open(my $fh, '<', NO_SUCH_FILE); 16}; 17 18is($@,"","Repeated autodie should not leak"); 19 20