#!/usr/bin/perl -w use strict; #use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use CGI ':standard'; my $data="/path/data.txt"; my $other_data="/path/other_data.txt"; my $checkfour = param('check'); my @other = (); open (OTHER, $other_data); while (my $line =) { my ($one,$two,$three,$four,$five) = split "\t",$line; if ($four eq $checkfour) { push (@other, $three); push (@other, $four); last; } } close (OTHER); my $checkthree = shift(@other); my $four = shift(@other); print header(), start_html(-title => ""); print "get $checkthree and $four then $checkfour
"; open (FILE, "$data"); while (my $line =) { my ($one,$two,$three,$four,$five) = split "\t",$line; if ($three eq $checkthree) { print "

With matching parameters I should be able to see this

"; last; } else {print "

If I put the else statement in it ignores the fact that the parameters match - and comes here! (But I don't know why).

"; last; } } close FILE; print end_html();