#this is the subroutine to search the file sub search{ open(FILE, ') { chomp; # remove newline @main::fields = split(/\|/, $_); # test whether the search string matches part number if ($main::fields[0] =~ /$PartNumber/ ) { print "$PartNumber Rev. $Revision has a First Article Report\nWould you like to view it?"; &continue; } else { &restart; } }}