use strict; use Data::Dumper; my %hash; OUTSIDE: while ( <DATA> ) { if ( /^-/ ) { my($name) = $_ =~ /BEGIN (.+?) -/; while ( <DATA> ) { redo OUTSIDE if /^-/; next if $_ != /^some/; chomp $_, push @{$hash{$name}}, [ $_ ]; } } } print Dumper \%hash; __DATA__ ------------------ BuildChecker BEGIN Abc ----------------- some text A1 some text A2 some text A3 some text A4 ------------------ BuildChecker BEGIN bcd ----------------- some text B1 some text B2 link: error: WhoKnowsWhat some text B3 some text B4 some text B5 some text B6 ------------------ BuildChecker BEGIN cde/fgh -------------- some text C1 some text C2 some text C3 ------------------ BuildChecker BEGIN ijk/123/ada ---------- some text D1 some text D2 some text D3 link: error: WhatsIt? some text D4 ------------------ BuildChecker BEGIN lmn/opq -------------- some text E1 some text E2 some text E3 link: error: OuchAnotherOne. some text E4 _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users