#/usr/bin/perl use strict; use warnings; #### Not complete code #### #### This is just a starting framework ### while (my $line = ) { handle_section ($line) if $line =~ /^Start:/; } sub handle_section { my $start_line = shift; my @buf; my ($parm) = $start_line =~ /Start:(.*)/; push @buf, $start_line; print "Staring Parm is: $parm\n"; my $line; while (defined ($line = ) and $line !~ /End/) { push @buf, $line; } # do something based upon End line (still in $line) # If not an End line, then malformed record # end of data was reached without an End line } __DATA__ Start:/abc/def ..... End 1.2 Start:/xyz/uvw ..... End 2.8