Hi All
the code below is doing a search on a file and outputting the results to screen.
i would like to give the user the option of doing another search. as you can see i have an if statement setup but i can't call the while loop.
how do i do it?
open (FILE, "files/comp.log"
$msisdn=<STDIN>;
chomp $msisdn;
print "searching...\n";
sleep 2;
print "searched OUTPUT file:\n";
while(<FILE>)
{
print if /$msisdn/;
$count++;
$count ||= "No";
}
print "\n$count records searched...\n";
print "do another search? Y\,N\n";
if (<> =~/^[y]/i)
{
}
else
{
exit;
}
close <FILE>;
thanks MoonHead("_"
the code below is doing a search on a file and outputting the results to screen.
i would like to give the user the option of doing another search. as you can see i have an if statement setup but i can't call the while loop.
how do i do it?
open (FILE, "files/comp.log"
$msisdn=<STDIN>;
chomp $msisdn;
print "searching...\n";
sleep 2;
print "searched OUTPUT file:\n";
while(<FILE>)
{
print if /$msisdn/;
$count++;
$count ||= "No";
}
print "\n$count records searched...\n";
print "do another search? Y\,N\n";
if (<> =~/^[y]/i)
{
}
else
{
exit;
}
close <FILE>;
thanks MoonHead("_"