X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=maps%2Fbin%2Fmapsutil.pl;h=15488fd063d449aa57abaead69d951c96d36d3f1;hb=64358086cfbaea4aa8f1eddc13161aff945523a8;hp=054f5fbd7424762b0cd5d1a101360e7771931d0d;hpb=ae9e57b169de143d2b8a7c761c3bf7394385e0d0;p=clearscm.git diff --git a/maps/bin/mapsutil.pl b/maps/bin/mapsutil.pl index 054f5fb..15488fd 100755 --- a/maps/bin/mapsutil.pl +++ b/maps/bin/mapsutil.pl @@ -15,7 +15,7 @@ use strict; use warnings; -use 5.030; +use 5.026; # For use of the given/when (See https://perlmaven.com/switch-case-statement-in-perl5) no warnings 'experimental'; @@ -203,7 +203,10 @@ sub LoadListFile($) { my $sequence = 0; - Info("Adding $listfilename to $listtype list"); + Info( + userid => $userid, + message => "Adding $listfilename to $listtype list", + ); while ($listfile) { chomp; @@ -242,29 +245,32 @@ sub LoadEmail($) { my $nbr_msgs; while (!eof $file) { - my ($sender, $reply_to, $subject, $data) = ReadMsg (*$file); + my %msgInfo = ReadMsg *$file; $nbr_msgs++; AddEmail( userid => $userid, - sender => $sender, - subject => $subject, - data => $data, + sender => $msgInfo{sender}, + subject => $msgInfo{subject}, + data => $msgInfo{data}, ); - Info("Added message from $sender to email"); + Info( + userid => $userid, + message => "Added message from $msgInfo{sender} to email" + ); } # while if ($nbr_msgs == 0) { - say "No messages found to load"; + print "No messages found to load"; } elsif ($nbr_msgs == 1) { - say "Loaded 1 message"; + print "Loaded 1 message"; } else { - say "Loaded $nbr_msgs messages"; + print "Loaded $nbr_msgs messages"; } # if - say "from $file"; + say " from $filename"; } # LoadEmail sub DumpEmail($) {