Here is one of the first Perl scripts I wrote at work. I was tasked with verify host connectivity after some desktop patches were pushed out. So instead of manually pinging each one, and I already had a text file with all the affected hostnames, I decided to put together a little script that would read from the text file and print out whether the host was up or down.
So, for this to work you will need a file called hosts.txt with a list of hostnames or IP address. Also, very simple shell script to read txt file into perl script. I could have excluded the shell script and just used Perl to open the file and add each line to an array, which would loop thru and do the same thing… it is on my TODO, but as it is, this works fine, and there’s always another script that needs to be written. Check it out. Read more »