my $data; while (read(DATA, my $d, 1024 * 1024 * 10)) { # 10mb $data .= $d; } my @lines = $data =~ /^[^\s\*].*$/gm;