Can't use string ("14") as a SCALAR ref ...
You're getting the error because $hostresults[0] apparently evaluates to 14 (what get_list() returns in scalar context), which you then try to dereference as a scalar by putting ${} around it.
It's not really clear to me what you want to be printed in line 28, so it's difficult to advise how to achieve it. In case you want to print some complex data structure, I'd recommend Data::Dumper (e.g. print "RESULTS = ", Dumper(\@results); ).
In reply to Re: using / accessing nested hash/array references
by Anonyrnous Monk
in thread using / accessing nested hash/array references
by tspfwj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |