$data_file="learn.data"; open(DAT, $data_file) || die("Could not open file!"); @raw_data=; @results = grep( /^$line[0]/, @raw_data ); foreach( @results ) { $record = $_; } #### open(I, $data_path); $found=0; while(){ chomp; @line = split(/\t/, $_); if($line[0] eq $GET{'id'}){ $found=1; last; } } close(I);