commit:     b0c007c6048b687f3b4b1bfc9a489192e5e9f40e
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 24 23:54:12 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Jun 24 23:54:12 2017 +0000
URL:        https://gitweb.gentoo.org/proj/elections.git/commit/?id=b0c007c6

Votify: debug spam.

Use of uninitialized value in subroutine entry at /etc/elections/Votify.pm line 
135.
  Votify::get_single_election_hashref("council-201706") called at 
/etc/elections/Votify.pm line 148
  Votify::get_elections_hash() called at /etc/elections/Votify.pm line 153
  Votify::get_open_elections_hash() called at 
/etc/elections/election-stats-count line 41

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 Votify.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Votify.pm b/Votify.pm
index d53cfcb..d24b8cb 100644
--- a/Votify.pm
+++ b/Votify.pm
@@ -129,10 +129,10 @@ sub get_single_election_hashref {
     return undef unless defined $election_dir;
     my %election;
     foreach my $fn (@REQUIRED_FILES){
-        #print "Scan $fn\n";
+        print STDERR "Scan $fn\n";
         my @filenames = (sprintf("%s/%s", "$basedir/$election_name", $fn), 
sprintf("%s/%s-%s", "$basedir/$election_name", $fn, $election_name));
-        #print Dumper(@filenames);
-        my $filename = abs_path(List::Util::first { -f $_ } @filenames);
+        print STDERR Dumper(@filenames);
+        my $filename = abs_path(List::Util::first { $_ && -f $_ } @filenames);
         $election{"${fn}file"} = $filename;
     };
     #print Dumper(%election);

Reply via email to