Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Reading Binary

by duelafn (Vicar)
on Jun 15, 2011 at 16:30 UTC ( #909806=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://909806]
help
Chatterbox?
[Discipulus]: yes, some semantic for the searxh must implemented before using such kind of query
[Corion]: Yeah - I have either to come up with a better search query or simply steal the template of some other file download site... I'm thinking of turning the JSON for Strawberry Perl releases into a small website that offers the files for download, with a ...
[Corion]: ... separate page per release, and potentially RSS for the versions

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2017-02-28 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (398 votes). Check out past polls.