open my $fh, '<', '/var/log/nginx/access.log' or die $!; say $_ foreach map { /"GET (\S+) .*?" 404/ ? $1 : (); } <$fh>;