while(<$filepath>) { print " $_"; } close ( $filepath ); while (<$filepath2>) { print "$_"; } close ( $filepath2 );