in reply to Removing non digits

Your loop variable is "$n", not "$num".
I'd do:
tr/0-9//cd for @array;
--perlplexer