in reply to Where is the zero coming from?

Try changing: $num = rand(@choices);

to: $num = $choices[ rand(@choices) ];

rand(@choices) will give you a random index (from 0 to 48).

Update: Changed @choices[ rand(@choices) ]; to $choices[ rand(@choices) ];

Replies are listed 'Best First'.
Re^2: Where is the zero coming from?
by Pauleduc (Initiate) on Aug 01, 2014 at 23:29 UTC
    Ah, now I understand... Thanks!