in reply to question on data structure

As AppleFritter said, it seems you would need an array of hash references. the code below would accomplish that.
#!/usr/bin/perl use strict; use warnings; my @data; my $keys = 'Log Name|Source|Date|Event ID'; { local $/ = ''; while (<DATA>) { chomp; my %temp = /($keys): (.+)/g; if (/^\s+Description:\s+(.+)\z/sm) { $temp{description} = $1; } push @data, \%temp; } } use Data::Dumper; print Dumper \@data;
Using the data you posted, it dumps:
$VAR1 = [ { 'Event ID' => '7320', 'Log Name' => 'Microsoft-Windows-GroupPolicy/Operational', 'Source' => 'Microsoft-Windows-GroupPolicy', 'description' => 'Error: Computer determined to be not in +a site. Error code 0x77F.', 'Date' => '2014-06-26T13:58:04.290' }, { 'Event ID' => '7320', 'Log Name' => 'Microsoft-Windows-GroupPolicy/Operational', 'Source' => 'Microsoft-Windows-GroupPolicy', 'description' => 'Error: Computer determined to be not in +a site. Error code 0x77F.', 'Date' => '2014-06-26T12:32:30.009' } ];
Chris

Replies are listed 'Best First'.
Re^2: question on data structure
by natxo (Scribe) on Jul 07, 2014 at 20:30 UTC
    hi,

    I just read your answer and I really like it, much more idiomatic than my clumsy baby perl. It does exactly what I need. Thanks!

      Glad it was useful for you!