in reply to Re^5: How do foreach loops use their list values?
in thread [Solved]How do foreach loops use their list values?

Oh wow thank you so much! I did not realise @words was not being reinitialised after each iteration through the loop (which makes sense, since it was declared outside the loop).

Thanks a lot, all of you, I think I learnt a lot by trying to understand this code. Have a nice Sunday.

  • Comment on Re^6: How do foreach loops use their list values?

Replies are listed 'Best First'.
Re^7: How do foreach loops use their list values?
by AnomalousMonk (Archbishop) on Nov 03, 2013 at 11:02 UTC

    If you're interested in permutations and genomic sequences and in advanced Perl techniques, you might want to grab a copy of Dominus's Higher Order Perl (HOP), with reference in particular to sections 4.3.1 "Permutations" and 4.3.2 "Genomic Sequence Generator". The book and its errata are freely downloadable here and well worth the bandwidth even if you're on dial-up. The material is a bit advanced, but if you're interested in a whiff of "air from another world", grab this, keep it around and dip into it from time to time.

    Another good freely downloadable book, one more designed for the sophisticated beginner in Perl (and one more in tune with current practice; HOP is perhaps just a bit dated in this respect) is chromatic's Modern Perl; see chromatic's user node for download links.

    Update: I just noticed that [Solved][HOP] Working with Iterators, why do I suddenly get a coderef? is by someone working with HOP; you might be interested.