open(IN,"+) { if (/sister/) { $where=tell(IN); $add="and brothers"; seek(IN,$where,0); print IN "$add"; next; } else { @lines = split(/\n+/); next; } } close IN;