my @common_letters; my @wordsCopy = @words; my $reference = shift @wordsCopy; while ($reference =~ /(.)/g) { ... }