http://qs321.pair.com?node_id=921437


in reply to Selecting certain bits from a TCP header

I don't really have experience with bit operations (in general and in Perl), but I remember a Perl function named vec which may help you.