in reply to matrix's
A simple mistake. The syntax for a (sparse) pseudo matrix in Perl is $table{$I,$K} (braces, not brackets). (Though this feature is not much used and so many may be unfamiliar with it.)