Dear Monks,
Please examine the following code. I am trying to use a type glob to access values in a hash.
use strict; use warnings; use 5.010; my %h = qw{a 1 b 2}; my @h = (100, 200, 300); my $h = 10; say $h{a}; say $h[0]; say $h; my $href = *h{HASH}; my %hash = %{$href}; say $hash{a}; --output:-- 1 100 10 No type glob foo for you!*
How can I use a type glob to get at the hash's values?
Thank you.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |