http://www.perlmonks.org?node_id=602589


in reply to Adding to array

using push:
chomp(my @lines = <IN>); push @list, @lines;

update: a complete different approach:

get @ARGV to contain the list of files to slurp, then slurp it all with <>:

@ARGV = grep { -s } map { defined $ENV{$_} ? "$ENV{$_}/common/wins.ini" : () } qw(TEST_DIR WINS_DIR); chomp(my @list = <>);