in reply to Trying to construct all possible strings from 4 bases [ATCG]
On the basis that you're more interested in getting the results rather than doing it yourself you may want to use the String::Combination module on CPAN which does what you need.
The following code seems to do the job..
# Get all the combinations of bases which have a prescribed length.
# Output the results.
print "$_\n" for @combinations;