in reply to Variable scope issue

A guess: I think it's @temp which is undefined because you're messing up $_ twice and your second open fails.

Can't test now...

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^2: Variable scope issue
by crickson (Initiate) on Jun 26, 2019 at 17:51 UTC

    The second open works and it is not @temp the issue, as I have verified both.

    It is really $score, as its previous initialization is not considered inside the IF.

      as I have verified both

      How? Unless there is a substantial bug in the version of Perl you are using, your assertion "as its previous initialization is not considered inside the IF" is wrong.

      What version of Perl are you using and on what platform?

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond