use strict; use warnings; open the first of the files w/server names; read contents to a $var; push $var to a new array (namely @all_server_names) rinse, repeat untill all files have been read and their content pushed Convert the above to code; execute