in reply to How can i catch strings matching a regex across multiple lines?

The problem is this line:

 push (@{$hash{$id}}, $1) if /(c\d+t\d+d\d+)/;

That checks the input record for your pattern, captures it, and pushes it onto the array pointed to by that ID. But it only does that once, so it finds the first one, pushes it, and moves on. To find them all, you'll need to tell your regex to repeat the search:

push @{hash{$id}}, /(c\d+t\d+d\d+)/g;

Aaron B.
Available for small or large Perl jobs; see my home node.