${hash}{"key"} is the same as $hash{"key"} (for reasonably named variables) so I'd suggest you adopt the second style for most uses. But in a string expansion, ${var} is used like $var but (at least usually) stops interpretting at the closing } (this is all a bit imprecise in an attempt to be DWIMish) so you can write "Sold $n ${item}s" instead of "Sold $n $item"."s". So "${hash}{'key'}" is the same as $hash."{'key'}".
And $hash{"key"} is the same as $hash{key} if "key" is just letters, numbers, and underscores. So you can use any of these:
to name just a few. - tye (but my friends call me "Tye")print "name is $input_queue{name}\n"; print "name is $input_queue{'name'}\n"; print qq<name is $input_queue{"name"}\n>; print "name is ".$input_queue{"name"}."\n";
In reply to (tye)Re: Hash Printing Question
by tye
in thread Hash Printing Question
by websavvy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |