| | |
Help with Perl script to verify IP addresses
![]() |
•
•
Join Date: May 2006
Posts: 1
Reputation:
Solved Threads: 0
I am having trouble getting this script started, if anyone has any ideas fell free to comment, i am new to perl script writing and am finding this one a bit difficult:
i need a Perl program which will check whether or not an IP Address entered by a user is in fact a valid one. The user is to enter the IP Address AS A COMMAND LINE PARAMETER eg the user will type check_ip.pl 192.168.9.23 and the script will attempt to validate the IP Address 192.168.9.23.
The script must first check whether the user has input any data at all and if not display an appropriate error message.
A valid IP Address must have:
punctuation characters are allowed within each octet)
Only one IP Address is to be input and validated (ie there is no looping through several IP Addresses)
menu for a network engineer.
i need a Perl script that would be useful for a network engineer. This script will display the following menu
Networking Tools
1. Show me the IP address of this PC
2. Show me the subnet mask of this PC
3. Show me the computer name of this PC
4. Quit
Please type your selection :
The user will type in their selection (1 – 4) and the script will keep running until the user types in 4. An error message will be given if the user inputs anything other than 1 to 4.
Example : if user selects “1�
If the user selects 1, the script will clear the screen and then display the following information on the screen :
“The IP address of this PC is <nnn.nnn.nnn.nnn>
Press any key to continue�
replacing the <nnn.nnn.nnn.nnn> address with the ACTUAL IP address of the PC
The message “The IP address ..� will remain on the screen until the uses presses any key, at which time the menu will be re-displayed.
i need a Perl program which will check whether or not an IP Address entered by a user is in fact a valid one. The user is to enter the IP Address AS A COMMAND LINE PARAMETER eg the user will type check_ip.pl 192.168.9.23 and the script will attempt to validate the IP Address 192.168.9.23.
The script must first check whether the user has input any data at all and if not display an appropriate error message.
A valid IP Address must have:
- 4 octets, each separated by “.�
punctuation characters are allowed within each octet)
- have the first octet between 1 and 255
- have the 2nd, 3rd & 4th octets between 0 and 255
Only one IP Address is to be input and validated (ie there is no looping through several IP Addresses)
menu for a network engineer.
i need a Perl script that would be useful for a network engineer. This script will display the following menu
Networking Tools
1. Show me the IP address of this PC
2. Show me the subnet mask of this PC
3. Show me the computer name of this PC
4. Quit
Please type your selection :
The user will type in their selection (1 – 4) and the script will keep running until the user types in 4. An error message will be given if the user inputs anything other than 1 to 4.
Example : if user selects “1�
If the user selects 1, the script will clear the screen and then display the following information on the screen :
“The IP address of this PC is <nnn.nnn.nnn.nnn>
Press any key to continue�
replacing the <nnn.nnn.nnn.nnn> address with the ACTUAL IP address of the PC
The message “The IP address ..� will remain on the screen until the uses presses any key, at which time the menu will be re-displayed.
![]() |
Similar Threads
- How to call a perl script in the C# app? (C#)
- I get the error no file or directory when i try to run a perl script (Perl)
- perl script help re: scope/structure for noob (Perl)
- Create a perl script for string matching (ASP)
- How to supress warning meesge when i run an command from perl script (Existing Scripts)
- On execution of perl script, popup asks if i want to save or run this file (Linux Servers and Apache)
- Calculate the amount of time in the linux process using perl script (Perl)
Other Threads in the Perl Forum
- Previous Thread: Replacing a field separator during a read.
- Next Thread: Suggestions for perl resources? Dealing with csv data.
| Thread Tools | Search this Thread |





