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


in reply to Re: Foreach Loops
in thread Foreach Loops

And, of course, the previous line is available at $arr[$x - 1]

(unless we're talking $x == 0)