in reply to Re^2: map to hash of arrays
in thread map to hash of arrays

please try this: push @{$hash{$1}}, $2 while $data =~ /object_label\s+:\s+(\S+)[^:]+:\s+(\S+)/g;

Replies are listed 'Best First'.
Re^4: map to hash of arrays
by emilford (Friar) on Jul 27, 2004 at 13:51 UTC
    That worked perfectly, thanks. So is the regex treating the data read in as a single string? There are line breaks, which I thought would require the /m modifier to get away with something like this. I understand the [^:]+ part that continues matching on anything that is not a :, but I thought the regex would end at the first line break?