http://www.perlmonks.org?node_id=36492

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am using a "foreach" to loop over every element, and call last as soon as I find a match. This is stored in a variable and I would like to store the preceeding list element in a seperate variable. Any tips?

Originally posted as a Categorized Question.