in reply to LSB to MSB

Have a hex value of 6bf 0110 | 1011 | 1111

What you really have is

6b f0

I've looked at "pack/unpack" but cannot figure it out.

Show your efforts. Usually, pack/unpack aren't used for flipping bits, you use & or | for that, see perlop

Your title hints what you really are talking about is

$ perl -le " print unpack 'H*', pack 'h*', '6bf'; b60f
or
$ perl -le " print join ' ', split /(....)/, unpack 'b*', pack 'h*', ' +6bf'; 0110 1101 1111 0000 $ perl -le " print join ' ', split /(....)/, unpack 'B*', pack 'h*', ' +6bf'; 1011 0110 0000 1111

Replies are listed 'Best First'.
Re^2: LSB to MSB
by Eliya (Vicar) on Aug 07, 2011 at 07:17 UTC
    What you really have is
    6b f0

    Why?  Normally, you can leave off leading zeros, i.e. 0x6bf is the same as 0x06bf or 0x000006bf.

    0x6bf0 is a different value, though:

    $ perl -le 'print 0x6bf' 1727 $ perl -le 'print 0x6bf0' 27632

      Why?...

      Thanks

      You can see from my code examples why I thought so, pack doesn't assume leading 0, and I did not make the integer connection