while (defined($_ = )) { print $_; print "adding value=key\n" if $. == 3; }