Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Test::More isnt undef

  • undef
use strict;
use warnings;

use Test::More tests => 2;

my $x;
isnt($x, undef);

$x = 1;
isnt($x, undef);
perl t/isnt_undef.t

Output:

1..2
not ok 1
#   Failed test at t/isnt_undef.t line 7.
#          got: undef
#     expected: anything else
ok 2
# Looks like you failed 1 test of 2.