crickson has asked for the wisdom of the Perl Monks concerning the following question:
This is probably a very simple question, but it is annoying me.
Code fragment:
my $score=100000; open (IN, $arq); while (<IN>) { open (IN1, $_); while (<IN1>) { my @temp=split(/\t/); if ($temp[1]<$score) {
When executing this code, it complains "use of unitialized value $score in numeric lt...".
I cannot figure out why the variable, defined in the top most level of the program is not the same in the IF condition.
TIA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Variable scope issue
by jwkrahn (Abbot) on Jun 26, 2019 at 19:12 UTC | |
by haukex (Archbishop) on Jun 30, 2019 at 10:26 UTC | |
|
Re: Variable scope issue
by BillKSmith (Monsignor) on Jun 27, 2019 at 15:27 UTC | |
|
Re: Variable scope issue
by LanX (Saint) on Jun 26, 2019 at 17:36 UTC | |
by crickson (Initiate) on Jun 26, 2019 at 17:51 UTC | |
by GrandFather (Saint) on Jun 26, 2019 at 21:11 UTC | |
by Anonymous Monk on Jun 26, 2019 at 18:14 UTC | |
|
Re: Variable scope issue
by Anonymous Monk on Jun 26, 2019 at 17:37 UTC | |
by crickson (Initiate) on Jun 26, 2019 at 17:52 UTC |