Ok, so I got an array of an array (AoA) and I need to pass it to a subroutine, and then access it. This works… but is it strictly correct and indeed is there a better way that I should be doing this?
#!/usr/bin/perl
$a = "deep";
push(@b,$a);
push(@c,\@b);
print "c = @{$c[0]}\n";
&test(\@c);
sub test
{
$d = $_[0];
print "sub c = @{$$d[0]}\n";
}
Thanks
Still needs better names. In particular,
$a
and$b
should be avoided as they can interfere withsort
.