in reply to syntax error

for(param()) { push @num, $_ if m/^d$+/ } will also work -that is, removing $_ and the erroneous operator altogether - since the default target for a pattern match operation is $_.

Some will consider this clearer because shorter; others will feel that implied variables in an expression are insufficiently clear. I lean toward the former, myself. It's a matter of personal taste - and whether you'd have to explain it.