4 ms·
>the code looks similar in Python Minus the sigils and crazy wrapping, like: @{ $TV{$family}{kids} } to refer to the array, but a different sigil/form if you'r
by tyingq 5y ago
>the code looks similar in Python
Minus the sigils and crazy wrapping, like: @{ $TV{$family}{kids} } to refer to the array, but a different sigil/form if you're talking about one element, etc.
Which may not look intimidating on its own, but it's leaving out % and the backslash \$reference syntax, $object->method and other things that get confusing.
You can't, for example really make a "list of hashes/dicts". Try it, and it just turns the keys/values into array elements. You have to specifically make a "list of references to hashes/dicts". So you do something like:
push(@list,\%hash);
Then, fun things like a double sigil:
foreach my $hashref ( @list ) {
print keys %$hashref;
}
Note there are several ways to do all this, and I am highlighting some of the more visually confusing ones.