open(INPUTFILE, "$database") or die "cannot open file: $!"; while ( ) { my $path_check=$_; #It should have all the entry from the db text file chomp($path_check); # $input{'nfirst'}) is one of the parameters from the form so it the value of $input{'slast'} if( $path_check eq $input{'nfirst'}) || ($path_check eq $input{'slast'}) ){ print "Dont Print entry to db text file and exit the loop here"; }else{ print "Print New Value(s) to db text file here and exit the loop
";} } close(INPUTFILE); _db sample D:/myfiles/Test/ E:/pics/cgi-bin/new/ C:/temp/ D:/new/files/ F:/new/more/ C:/test/cgi-bin/ac/^ok C:/new/files/ # This line shouldn't be allowed here, it is duplicated.