foreach is often used with single element as a convenient method of both setting $_ and providing a block in which last can be used.
As for your problem, the code is equivalent to:
foreach --+ +-- first iteration | | v v print( (@$res)[0]->[0], "\n"); ---------- | +-- What $_ contained
or just:
print "$res->[0][0]\n";
In reply to Re:Array Deferencing Question
by ikegami
in thread Array Deferencing Question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |