Print $lookup rather than $i for "out of bounds" condiltion.
In reply to Re: Improve my lookup script by BillKSmith in thread Improve my lookup script by jjap