Now we're talking my language... networking and network penetration testing :)
The return you get is definitely a reference to a hash, but it is a blessed() hash, meaning it is an object (aka instance of a class (package)).
Per the SYNOPSIS of perldoc Nmap::Scanner, we see that: $results is an instance of Nmap::Scanner::Backend::Results.
What you're doing to extract the parts of the return are typical for a hash, but if you can specify what exactly you're trying to do, it may help us sort out a different/better/cleaner way. For the most part, you want to use the object's methods to extract the data you need (if the class has the methods to do so) instead of opening the object up like a can of tuna. Not all classes have such methods available though (and if this one doesn't, I've found my module to work on) :)
You might be interested to read Nmap::Scanner::Backend::Results documentation and the rest of the sub-modules for methods that may allow you to extract the info you need using the object's built-ins. (Nmap::Scanner module listing).
Beyond that, again, state what it is you need out of the object.
-stevieb
In reply to Re: Parsing output from Nmap::Scanner with varying hash address.
by stevieb
in thread Parsing output from Nmap::Scanner with varying hash address.
by mopmeat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |