http://qs321.pair.com?node_id=11113411


in reply to reading input into a number of arrays

Perl doesn't support the comma separated indices for multidimensional arrays. Instead of
$a[$i, 1]

use

$a[$i][1]

Update: Use warnings, Perl will tell you:

Multidimensional syntax $a[$i,1] not supported at ...

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: reading input into a number of arrays
by tobyink (Canon) on Feb 25, 2020 at 21:41 UTC

    You can emulate multi-dimentional arrays with hashes though. It's a feature not many people use.

    my %multidim; my $x = 3; my $y = 4; $multidim{ $x, $y } = 42; print $multidim{ $x, $y }, "\n";
Re^2: reading input into a number of arrays
by Dannypje (Initiate) on Feb 25, 2020 at 16:11 UTC
    Choroba, thanks! I knew this. My shame is infinite.