in reply to Re^2: Regular Expressions Challenge
in thread Regular Expressions Challenge
my @data = split /\n/, $str; my @section; my $i = 0; while (@data) { $_ = shift @data; if (/^===Comments===$/) { while (@data) { $_ = shift @data; last if /^=/; $section[$i] .= "$_\n"; } $i++; } }
|
|---|