#!/usr/bin/perl use strict; use warnings; my $html_report = ''; my $data_file = ''; my $content = ''; my $bug = parse_file($html_report); add_to_file($bug); sub parse_file{ my ($file) = @_; local $/; open(my $fh,'<',$html_report) or die $!; my $content = <$fh>; close $fh; my ($bugnumber,$package) = $content =~ /(#\d+)\s?([^\s]*?)\s*?-/i; my ($submitter) = $content =~ /pkgreport\.cgi\?submitter=([^"]*?)/; my ($maintainer) = $content =~ /pkgreport\.cgi\?maint=([^"]*?)/ ? "unknown" : $submitter; my ($date) = $content =~ /Date:\s?(.*?)\s?UTC/; my ($severity) = $content =~ /Severity:\s?(.*?);/; return join(',',$bugnumber,$submitter,$maintainer,$package,$date,$severity); }# parse_file sub add_to_file{ my ($file,$bug) = @_; open(my $fh,">>",$file) or die $!; print $fh $bug,"\n"; close $fh; }#add_to_file