#Trying to get default values working here -- still working on it
####
chomp($ipbase = );
####
$ipbase = ;
chomp ($ipbase);
####
#I would like to find a way to turn off echo or mask this portion
print "Password:";
$password = ;
####
open(INFO,">$downreport");
####
open INFO, '>', $downreport or die "Cannot open $downreport:$!\n";
####
open my $info, '>', $downreport or die "Cannot open $downreport:$!\n";
####
print "What is the base IP? (Example: 192.168.1)\n";
$ipbase = ;
chomp ($ipbase);
print "What is the bottom IP? (Default 1)\n";
$ipcurrent = ;
chomp ($ipcurrent);
print "What is the top IP? (Default 255)\n";
$ipend = ;
chomp ($ipend);
# etc....
####
sub get_user_input {
my $prompt = shift;
print "$prompt\n";
return chomp()
}
####
$ipbase = get_user_input("What is the base IP? (Example: 192.168.1)");
$ipcurrent = get_user_input("What is the bottom IP? (Default 1)");
$ipend = get_user_input("What is the top IP? (Default 255)");