in reply to Re^3: perl bit matrix transposition / weak typing problem
in thread perl bit matrix transposition / weak typing problem

Well, $out is getting set by:

for my $col (0..($BUFSIZE-1)) { $out[$newrow] |= (1 << $col) if ($in[7 - $col] >> $row & 1); } $newrow++;

This is setting the actual bit in $out[$newrow] if the corresponding bit from the transposition source matrix is set.

At any rate, BrowserUk's solution appears to be ideal and small, and exactly fits the requirements; the lack of thorough awareness of the vec() function made this difficult at best. In addition, it makes possible arbitrary matrix sizes, which solved another challenge I had thought of but didn't mention in the original post.

Thanks,
Jason