while ( ) { if ( /^=begin/ .. /^=end/ ) { read each line between, and including, "-begin" and "=end" } }