Argh. This ain't my day. My parameters were in the wrong order, it's
my ($ver, $hlen) = (vec($ver_hlen, 0, 4), vec($ver_hlen, 1, 4));
or also
my ($ver, $hlen) = map(vec($ver_hlen, $_, 4), (0 .. 1));
The 4 means I want to treat this as an "array" of 4-bit-elements, and the offset specifies the "index" in that "array". I hope I haven't left any errors still to correct this time. grumble