rahulruns has asked for the wisdom of the Perl Monks concerning the following question:
I need to write a SCRIPT where it will ask user to enter IP address for entities like Netmask, Gateway, DNS, bonds etc. and will check if valid IP is enetered. If the IP is not valid it will ask to enter it again for the specific entity till the IP entered is correct. The IP could be any IP but a valid IP address. The issue I am facing is how to repeatedly ask for IP of specific entity like Netmask till IP is correct. Sample of code what I am writing is below
use Data::Validate::IP qw(is_ipv4); use Data::Dumper; my %ipaddress_namei = (); print "Enter IP address of Bond2\n"; my $bond2 = <STDIN>; $ipaddress_namei{bond2} = {$bond2};
|
|---|