http://www.perlmonks.org?node_id=909806


in reply to Reading Binary

You can use vec for this

#!/usr/bin/perl use strict; use warnings; my @letter = 'A'..'Z'; my $bits = pack "b*", "1001"; for (0..8*length($bits)-1) { print $letter[$_] if vec($bits,$_,1); } print "\n";

Good Day,
    Dean

Replies are listed 'Best First'.
Re^2: Reading Binary
by BoulderBuff64 (Novice) on Jun 20, 2011 at 22:19 UTC
    This is the method I ended up using. Thanks!