in reply to Re^5: pulling more data from an array
in thread pulling more data from an array
Your results is what I'd like to see, my results were not that positive. While the formatting of the data (array) should be the same, the actual data can be different. For example, some may just have one line and then an '!" as:
snmp-server host 10.10.21.14 publ !
but others may end up with more data as:
snmp-server host 10.234.171.38 abcd snmp-server host 10.234.171.39 abcd snmp-server host 10.234.171.40 abcd !snmp-server host 10.10.10.1 xyz
But they all should be formatted the same. I commented out the result_1 code and added the two print lines and got unexpected results. For
print for split /(?<=\n)/, $res->result(); I got ARRAY(0x100dd10)
Yet when I did the
print Dumper $_ = $res->result();I got:
$VAR1 = [ 'snmp-server host 10.234.171.38 abcd snmp-server host 10.234.171.39 abcd snmp-server host 10.234.171.40 abcd !snmp-server host 10.10.10.1 xyz !' ];
I noticed this result is the same as
print (Dumper([$res->result()]));so it's something with the array and that's causing the code not to work as planned.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: pulling more data from an array
by kennethk (Abbot) on Aug 05, 2010 at 22:39 UTC |