import.pl untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 34 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use strict;
2 use Data::Dumper;
3 use Amethyst::Store;
4  
5 my $store = new Amethyst::Store(
6 Source => 'factpack',
7 );
8  
9 foreach (<>) {
10 next if /^\s*#/;
11 next unless /=>/;
12  
13 /^(.*?)\s*=>\s*(.*)/;
14 my ($key, $val) = ($1, $2);
15  
16 # $val =~ s/^<reply>\s*\$who, //;
17  
18 my $skey = lc $key;
19 my $sval = lc $val;
20  
21 my $href = {
22 verb => 'is',
23 };
24 $href->{key} = $key if $key ne $skey;
25 $href->{val} = $val if $val ne $sval;
26  
27 my $data = $store->get($skey);
28 $data->{$sval} = $href;
29 $store->set($skey, $data);
30 }