in reply to virus log parser

I would not try using the input seperator for doing things like this.. It's a lot easier to parse this line by line..:

# open file, DB-connection, etc.. my %data; while (my $line = <INPUT>) { chomp ($line); if ($line =~ m/^-+$/) { &save (%data); %data = (); } elsif ($line =~ m/^(\w+):\s(.+)$/) { $data{lc($1)} = $2; } elsif ($debug) { warn $line; } } sub save { # up to you :) }

You should note that the regex is not optimal. If it was as easy to read as the above I would have written m/([^:]+):\s/ with $1 and $'..Dig intp perlre when interested. Another thing to note it that you should make sure that all the keys of that hash you want to save to a database has all well defined values! Oh, last but not least: The only reason I wrote &save was to demonstrate that it is not a build-in function..

Regards,
-octo-