demichi has asked for the wisdom of the Perl Monks concerning the following question:
I would like to dereference a Hash of Hash within a string.
Normally I do it like this
print "MyText${var}ishere";
How can I use the brackets when dereferecing a Hash of hash?
This does not work:
print "MyText${ref_HoH}->{$var}->{key}ishere."
print "MyText${ref_HoH->{$var}->{key}}ishere."This works but I think this not a very good way ...
print "MyText$ref_HoH->{$var}->{key}ishere."
Thanks for help.
regards de Michi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dereference Hash of Hash - print
by LanX (Saint) on Oct 12, 2014 at 21:13 UTC | |
|
Re: Dereference Hash of Hash - print
by Athanasius (Archbishop) on Oct 13, 2014 at 03:10 UTC |