{ local $/ = "}\n"; # end-of-record string # (might need "}\r\n", if data is CRLF style) while (<>) # this reads a whole multi-line record { my ( $cellname ) = ( /^\s*cell\s+(\S+)/ ); my ( $area ) = ( /area\s+(\d+)/ ); # and similarly for other items of interest... # print according to taste } }