my $q = new CGI; $fh1 = $q->param('MEASURED_SPECTRUM'); # these are really file-handles $fh2 = $q->param('SEQUENCE'); ... while (<$fh1>) { ... } ... while (<$fh2>) { ... }