#!/usr/bin/perl -w use strict; open ONE, '<', "one.txt" or die "First File: $!\n"; open TWO, '<', "two.txt" or die "Second File: $!\n"; until( eof( ONE ) and eof (TWO)) { my $one = ; my $two = ; $one ||= ""; $two ||= ""; chomp($one); chomp($two); print "$one\t$two\n"; } __END__ OUTPUT: a this is 0 file two ab dsf one.txt: a 0 ab dsf two.txt: this is file two