I have a working PoC below which utilizes eval and I'm looking for feedback on whether I'm overlooking a way to achieve the same results without using eval.
#!/usr/bin/perl use strict; use warnings; my $usr_str = "{depTar}{name}"; my $xml = { 'depTar' => { 'name' => 'c_p20', 'loc' => 'srvr1' }}; my $dyn = '$xml->' . "$usr_str"; print eval $dyn;
In reply to "Dynamically" Accessing a HoH by Nitrox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |