use IO::File; my $output_fh = IO::File->new( 'fullstaffinfo', 'w' ) or die $!; for my $input () { my $input_fh = IO::File->new( $input, 'r' ) or die $!; $output_fh->print(do { local $/ = undef; <$input_fh> }); $input_fh->close; } $output_fh->close;