my $q = CGI->new(); my $upload = $q->upload('upload'); open(my $second, '<', 'second_file.dat') or die($!); open(my $out, '>', 'output.dat') or die($!); for my $fh ($upload, $second) { print $out $_ while <$fh>; }