in reply to Re: otherwise condition
in thread otherwise condition

The else statement doesn't do what the OP asked, which is to set $lastchain = '@' if NO lines are matched. As written, if every line but the last matches, $lastchanin will still be set to '@'.

--Bob Niederman, http://bob-n.com

All code given here is UNTESTED unless otherwise stated.