Вопрос

After introducing:

use strict;

My 2-dimensional array do not work any more, and I find no description and no example in the documentation how to predeclare them. So, what have I to do?

Это было полезно?

Решение 2

You declare it in just the same way you would a 1D array:

use strict;
use warnings;

my @AoA =  ( ['a', 'b'], ['foo', 'bar'] );

print Dumper \@AoA;

$VAR1 = [
          [
            'a',
            'b'
          ],
          [
            'foo',
            'bar'
          ]
        ];

Другие советы

It's impossible to give much useful help from the details that you give. Just including the text of the error message would have been useful.

In general, when you have an error that you don't understand, it's a good idea to add use diagnostics to your code. That will give you longer explanations of any errors and warnings that are generated.

(But that should be seen as a development tool - you shouldn't leave it in the code when it goes into production.)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top