use Test::More tests => 6; my %h = ( undef() => 1 ); foreach my $key ( keys %h ) { ok( defined $key, 'key is defined' ); is( $key, '', 'key is empty string' ); } is_deeply( [ '' ], [ keys %h ], 'undef key' ); is_deeply( [ 1 ], [ values %h ], 'values works' ); is( $h{undef()}, 1, 'undef key accesses value' ); is( $h{''}, 1, 'empty string key accesses value' );