Hello everyone. What I want to do is go through a loop, and when it has gone through that loop one or more times, I want it to run a subroutine. The code I have so far is this:
The first time the loop runs, it will give that hello message after you first load the file. After that, I want it to run another version of the block with the numbered options that allows you to open a different file as a sixth choice. Whenever I run that loop it always stays with the first iteration's hello message.
/
is my latest attempt, before that I tried
,
, and
loops to no avail. I know I'm just missing one simple thing. Help please?
Code:
print "\n\nPlease enter the name of the file to load: ";
$DB = <STDIN>;
chomp($DB);
INPUT: $Choices = <<'OPTIONS';
Hello! What would you like to do with the file?
1) Filter hits by blocked content
2) Filter hits by passed content
3) Filter hits by IP address
4) Count IP address instances
5) Exit the program
OPTIONS
print "\n\n$Choices";
print "Your choice: ";
$PickNumber = <STDIN>;
chomp($PickNumber);
$i == 0;
do {
$i ++;
if($PickNumber == 1) {
readme();
goto INPUT;
}
elsif($PickNumber == 2) {
print "\n\nCan't filter hits by passed content yet.\n";
goto INPUT;
}
elsif($PickNumber == 3) {
print "\n\nCan't filter hits by IP address yet.\n";
goto INPUT;
}
elsif($PickNumber == 4) {
print "\n\nCan't count IP address instances yet.\n";
goto INPUT;
}
elsif($PickNumber == 5) {
print "It's been a pleasure, see ya next time!\n";
exit;
}
} until $i != 0 || input2();
Code:
do
Code:
until
Code:
for
Code:
until
Code:
while