open(FILE,"< tiles.txt") or die "error opening tiles.txt $!"; tie @text, 'Tie::File', 'tiles.txt' or die $!; @text = shuffle(@text); while () { ($File[$i], $Name[$i], $Keywords[$i]) = split(/:/); chomp ($Keywords[$i]); $i++; } close(FILE);