in reply to Last position of array

The most normal way to get the position of the last entry in an array is via $#arrayname, so:
print $B[$#B][0] . "\n";

One world, one people