Kraetos
2008-05-13, 14:30
The title of this one is pretty self explanatory. I need a perl script to just list the names of all of the computers on the local network. I feel like this shouldn't be difficult, but I'm getting nowhere with it.
My first thought was to run netstat from the script, pipe the input to a text file and regex it for the names, but, running netstat from the shell gives me an incomplete list, so that's no good.
I poked around in the perldoc and found gethostbyaddr(), but it doesn't seem to be working. I feed it an ip address and it gives me nothing back.
I'm pretty lost on this one :( Any ideas?
My first thought was to run netstat from the script, pipe the input to a text file and regex it for the names, but, running netstat from the shell gives me an incomplete list, so that's no good.
I poked around in the perldoc and found gethostbyaddr(), but it doesn't seem to be working. I feed it an ip address and it gives me nothing back.
I'm pretty lost on this one :( Any ideas?