in reply to syntax error

Try this (change "~=" to "=~"):

for(param()) { push (@num, $_) if $_ =~ m/^d$+/ }