in reply to Reading chunks of text
or maybe you want a hash and use the window handles as keys:my @p; while (<DATA>) { push @p, [], if /^Window/; push @{$p[-1]}, $_; }
my %h; while (<DATA>) { $key = $1, next if /^Window ([^:]+)/; push @{$h{$key}}, $_; }
|
|---|