in reply to creating all possible random 'words' from 4 letters

There are numerous modules to do permutations. List-Permutor may fit the bill. E.g.

#! /usr/bin/perl -w use strict; use List::Permutor; my @data = qw / A B C D /; my $perms = new List::Permutor @data; while (my @set = $perms->next) { print "@set\n"; }

inman