in reply to Global variables question

If you indent your code properly, it should be easy to see in which block @digest1 is declared, and in which blocks it's used. The mismatch should be clear. But it's very hard to understand your code as it's presented now.

Furthermore, my $digest1[$i] is a syntax error. You cannot declare an array element as a lexical variable.

Replies are listed 'Best First'.
Re^2: Global variables question
by PerlScholar (Acolyte) on Aug 24, 2010 at 10:51 UTC
    Hi thanks for your reply. I can see the mismatch but the problem is that when I change @digest1 to global variable I still have the same problem. I tried to resolve this by removing @digest1 from the inside the loop but that also gave an error:

    Can't call method "b64digest" on an undefined value at Z:/My Documents/Workspace/DeployChecker/Test.pl line 50.

    Any ideas? Many thanks!