Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Code Issue after Upgrading the perl from 5.14.4 to 5.22.3

by stevieb (Canon)
on Feb 10, 2017 at 15:36 UTC ( [id://1181681] : note . print w/replies, xml ) Need Help??


in reply to Re: Code Issue after Upgrading the perl from 5.14.4 to 5.22.3
in thread Code Issue after Upgrading the perl from 5.14.4 to 5.22.3

It is in the correct scope the way it is being used (global in this case), it's just difficult to tell because of poor code formatting. It should all be left-justified, with the exception of the statements within the while and unless statements, which should be indented only once.

Perl::Tidy can help those who are unfamiliar with proper indentation get a good grasp of it.

my %CONFIG_PARAMS; my $mapattach; while (my ($key , $value) = each(%CONFIG_PARAMS)) { if ($file =~ /$key/) { $mapattach = $value; } } unless (defined $mapattach) { Println "WARN : Ignoring $file, not found in the config file"; }

What I see is that %CONFIG_PARAMS has been declared, but not defined, so it'll always be empty. However, perhaps this isn't the real code OP is really using, which makes troubleshooting the issue pretty much impossible.