open FH, '+) { print $_; if ( /^2/ ) { print FH "two\nhi hello\n"; } }