Well, I did look deeper, and I mostly understand what's going on now, but one thing does still surprise me.
say $transcripts{$transcript_ip}{$transcript_id};
+ # gives me the hash reference of the lowest (3rd deep
+ hash)
say %{ $transcripts{$transcript_ip}{$transcript_id} };
+ # gives me that entire hash (key value pairs)
say %{ $transcripts{$transcript_ip}{$transcript_id} }{@transcri
+pts_columns}; # gives me my desired slice of that hash (key value p
+airs)
say keys { %{ $transcripts{$transcript_ip}{$transcript_id} }{@transcri
+pts_columns} }; # gives me my desired slice of that hash (keys only)
say @{ $transcripts{$transcript_ip}{$transcript_id} }{@transcri
+pts_columns}; # gives me my desired slice of that hash (values only
+)
What slightly surprised me is that the 3rd line above (with the leading %) gives the key value pairs and not just the values, but that made sense when I considered that I did essentially ask it to give me a hash and of course Perl would give a list of key value pairs when I do that. What still surprises me is that the last line simply by changing the leading % to a @ gives just the values to the list. Don't get me wrong though, that's darned convenient, and I'm really glad Perl does that.
I didn't even realize that's the same thing I had done before in the first line of code I gave in my original post until I went back and considered it more. For some reason that made complete sense to me at the time... or more likely I guessed, got lucky, and didn't inspect further because I didn't have to at the time. :-)
I love it when things get difficult; after all, difficult pays the mortgage. - Dr. Keith Whites
I hate it when things get difficult, so I'll just sell my house and rent cheap instead. - perldigious
|