open (my $in, "<", $ARGV[0]) or die "in: $@"; my @lines = grep { not /^#/ } <$in>; #<> here in list context, therefore no explicit loop