my %objects; my $object; while (<>) { chomp; if ( my ($object_type, $object_id) = /^\s*object-group\s+(\S+)\s+(\S+)/ ) { $objects{$object_id} = $object = { type => $object_type, entries => [], }; } elsif (my ($entry) = /^\s*\S+-object\s+(.*)/) { push @{ $object->{entries} }, $entry; } }
In reply to Re: Help on multiline regex
by ikegami
in thread Help on multiline regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |