Hi there, newbie here. I'm trying to compile a program which has to generate an array containing random numbers (including negative ones), but no more than 19. After that, every positive number in the above-mentioned array has to be deleted, making it contain only the negative ones. The whole code looks like this:
use feature qw/say/;
push @rand, $number;
last if $i==$all_the_numbers;
next; #in order to make it skip the negative ones
last if $h==$all_the_numbers;
However, this resoults in deleting only the positive numbers that come before the first negative one in the array, leaving what comes right after it untouched... So, how is it that the while loop doesn't keep on deleting the positives? Here's a picture to better explain myself: https://i.ibb.co/Gkmj8jc/Immagine.png
Thanks in advance.