I am a newbie in perl and I need to produce a script in perl to work and achieve the following:
1) Look into the file /etc/defaultrouter , and store the value in it
2) If the value is a number, go to LIST and print out the second column corresponding to the value.(eg London)
3) If the content of /etc/defaultrouter is not a number then go to /etc/host to check for the corresponding number
4) Get the number in step 3 and execute step 2
Content of LIST
22.123.2.1.1 canada
192.11.2.1 india
177.235.1.1.1 spain
172.44.5.1 london
66.112.4.1 newyork
if anyone has done this before, kindly post it or if the gurus can help out.
Thanks
Ibroxy