Reason #145 why Perl! is awesome...
Reason #145 why Perl! is awesome… and you are all idiots.
I don’t know exactly the mechanics of this process, but for some reason Perl! can create hash properties when you don’t want it. Look at the example
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my %hash = (
'Parent' => {
'Child' => [qw(kiu piu liu)]
}
);
sub some_hellish_funk
{
print "piu piu piu \n";
}
some_hellish_funk($hash{'NON-existent-HASH-PARENT'}{'child'});
print Dumper \%hash;
And a result :
piu piu piu
$VAR1 = {
'NON-existent-HASH-PARENT' => {},
'Parent' => {
'Child' => [
'kiu',
'piu',
'liu'
]
}
};
For some unidentified reason ‘NON-existent-HASH-PARENT’ property arised there. Please, comment if you know the reason, thanks, ya. Here is a playground.