I have two pieces of code that, it would seem, should give the same result, but the latter leads to an error.
1
my $href = undef; my @values = values %{ $href };
2:
my $href = undef; my %hash = %{ $href };
Why does having values on one line let it work? I would prefer that both of them give an error, since using the undefined value as a hash link is clearly an error. I do not have more recent perl versions for testing, but this was reproduced in 5.8.8 and 5.10.1.
source share