3 ms·
> I am sure there are people that easily remember the syntax for returning a reference to a hash of hashes, or whatever. Ehhhhh. I appreciate the opaqueness of
by fennecfoxen 6y ago
> I am sure there are people that easily remember the syntax for returning a reference to a hash of hashes, or whatever.
Ehhhhh. I appreciate the opaqueness of Perl, but you've described something like the easiest data structure in Perl to write and access: return {"foo" => {"bar" => "baz"}}; return {foo => {bar => "baz"}}; $data->{foo}{bar} = "quux"; etc etc.
It's when you drop away from the land of hashrefs and listrefs, and have to use plain old hashes and lists, that things actually get super weird - because most programming languages you're used to simply give you "refs" for everything, and they definitely don't have concepts like "list context" that let you merge lists by saying @a = @b, @c;
- WesolyKubeczek 6y agoA wild Python suddenly appears: third_list = [*first_list, *second_list] You don't even need a "list context" for this!
- fennecfoxen 6y agoI agree. That's how normal languages do it. But Perl's "normal" is one level up, and 80% of data structure confusion in Perl comes from that.