use
strict;
use
warnings;
package
testlib::FailTieHash;
use
Tie::Hash;
sub
TIEHASH {
undef
}
package
main;
use
Test::More;
use
Tie::Hash;
{
my
$href
= tieh(
"Tie::StdHash"
);
is
ref
(
$href
),
"HASH"
,
"tieh should return a hash-ref"
;
is
ref
(
tied
(
%$href
)),
"Tie::StdHash"
,
"... and it's backed by the tied class."
;
}
{
my
$href
= tieh(
"testlib::FailTieHash"
);
is
$href
,
undef
,
"If tie() fails, it returns undef"
;
}
done_testing;