while () { if (m/$something/) { # so which one is better # seek(INPUT,$last,0) # seek(INPUT,tell(INPUT)-$last,1); } $last = tell(INPUT); }