in reply to Deleting certein elements from an array

To push tybalt89's very good and concise solution one step further, you can make it a single line of code, as in the following Perl one-liner:
$ perl -wE 'say join " ", grep $_ < 0, map 20 - int rand 30, 1 .. rand + 20;' -6 -9 -2