while(scalar @num < 5){ push @num, int(rand(50) + 1); }