use 5.010; use Test::More; use IO::Handle; open my $fh, ">", "/tmp/foo" or die "argh"; ok $fh->can("close"); ok UNIVERSAL::can($fh, "close"); done_testing(); __END__ not ok 1 # Failed test at fh.pl line 7. not ok 2 # Failed test at fh.pl line 8. 1..2 # Looks like you failed 2 tests of 2.