X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FCommon.pm;h=2bc3e0dfe3280143f0243b6ae8df189376ead1a7;hb=1a1fa6f0af2be9d4076d9aad5f5a84c5fb3d9a8a;hp=abc98dc6efe6f5d65191ae3f012004c4ff8891f1;hpb=593feb86562b711efd71e4d03239e188ddeea051;p=debbugs.git diff --git a/Debbugs/Common.pm b/Debbugs/Common.pm index abc98dc..2bc3e0d 100644 --- a/Debbugs/Common.pm +++ b/Debbugs/Common.pm @@ -31,7 +31,7 @@ with equivalent (or better) functionality here. use warnings; use strict; use vars qw($VERSION $DEBUG %EXPORT_TAGS @EXPORT_OK @EXPORT); -use base qw(Exporter); +use Exporter qw(import); BEGIN{ $VERSION = 1.00; @@ -435,11 +435,8 @@ sub __add_to_hash { binmode($fh,':encoding(UTF-8)'); while (<$fh>) { chomp; - my @elements = split /\t/; - next unless @elements >=2; - # we do this because the source maintainer file contains the - # archive location, which we don't care about - my ($key,$value)=($elements[0],$elements[-1]); + next unless m/^(\S+)\s+(\S.*\S)\s*$/; + my ($key,$value)=($1,$2); $key = lc $key; $forward->{$key}= $value; if (defined $reverse) { @@ -940,7 +937,7 @@ sub cleanup_eval_fail { # ditch the "at foo/bar/baz.pm line 5" $error =~ s/\sat\s\S+\sline\s\d+//; # ditch croak messages - $error =~ s/^\t+.+\n?//g; + $error =~ s/^\t+.+\n?//mg; # ditch trailing multiple periods in case there was a cascade of # die messages. $error =~ s/\.+$/\./;