Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Multidimensional syntax $saveurl[$i,0] not supported at ./maindl.pl li +ne 36. Useless use of private variable in void context at ./maindl.pl line 36 +.


And how do I declare my var so I don't get it?

retitled by Chady.

Replies are listed 'Best First'.
Re: what does "multidimensional syntax" mean?
by davido (Cardinal) on Dec 24, 2003 at 06:00 UTC
    perldiag explains the error message further:
    Multidimensional syntax %s not supported (W syntax) Multidimensional arrays aren't written like $foo[1,2,3]. They're written like $foo[1][2][3], as in C.

    Perl handles multidimensional arrays as an array of references to arrays. In Perl, $saveurl[$i,0] isn't a 2d array (and, causes errors to be reported). You want $saveurl[$i][0], which represents an array of refs to arrays.

    It's a little tricky at first. See perllol for details, and perlreftut. Those documents should get you going in the right direction.


    Dave

      Thank you!