# File: arrayRand.pl # Title: Arrays in Perl. Array (@) rand n -> 0-n float, less than n # Author: Mihaela Malita # Make an Array with 5 random ints (1-6) # Array is 32566 #srand(time|$$); # set seed for random algorithm, time divided by $$ @A = (); #declare empty array $many = 5; #how many elements for (1..$many) { #do this $Many times $x = int(rand 6) + 1; #generate random int: 1-6 push(@A,$x); #add to your array } print "Array is ", @A, "\n"; exit;