I seem to recall (though can’t find any reference now) to one being able to do something akin to
my @a = ("foo","bar");
my ($item1, $item2) = @a;
The above does not do what I want it to (obviously) but I seem to recall that there is some way to do this, where it loads the items associated with the order of the scalars in the parenthesized list.
For that matter I thought that’s how the args array is passed into subroutines, as in…
sub method{
my ($arg1, $arg2) = @_;
}
Maybe I’m just going out of my mind, but I thought this was possible.
[EDIT]
Ah…so based on the first answer I realize that the reason it’s not working is that I’m using a two dimensional array. So, in my code it actually looks like this:
foreach(@twoDimenArray){
my ($item1, $item2, $item3) = $_; #$_ is an array
}
It must be the $ syntax that’s screwing it up but I’ve tried ($_) and @($_) and @$_ and none of those work.
Try using
@{$_}: