where $last holds the "preceeding list element" of the current item and $found holds the "preceeding list element" of the item that matches.foreach $item (@array) { if (matches($item)) { $found = $last; last; } $last = $item; }
In reply to Re: How do I find the array element directly preceeding a 'match'?
by amelinda
in thread How do I find the array element directly preceeding a 'match'?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |