Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rjbs (4671)

  (email not shown publicly)
AOL IM: RicardoJBSignes (Add Buddy, Send Message)
Yahoo! ID: RicardoSignes (Add User, Send Message)

I'm a Perl coder living in Bethlehem, PA and working Philadelphia. I'm a philosopher and theologan by training, but I was shocked to learn upon my graduation that these skills don't have many associated careers. Now I write code.

Journal of rjbs (4671)

Saturday October 01, 2005
11:46 PM

stupid new module

[ #26965 ]

On #perl today, Jesse was asking about a module to convert binary data into a string using only explicitly permitted characters. This was a problem I encountered a year or two ago when trying to use MD5 sums as worksheet names in Excel. Excel has some weird subset of Latin-1 as valid characters in worksheet names. Unfortunately, when I went to pull up the code, I found that the only revision I took with me from IQE was missing most of that code (which I had replaced with something simpler).

Anyway, I said something like, "It's really trivial, it's just a simple matter of programming," to which Jesse replied, "I'd love to see it on the CPAN." (Actually, I think he is part of the majority that doesn't use the "the" in "the CPAN.") It seemed like a fun little distraction, so I sat down after dinner and busted out Number::Nary. To be fair, it doesn't work on arbitrary bitstrings. It wants a numeric value. It's easy enough to get from a bistring to a number, though.

Wait, it is, right? I know this is one of those pack/unpack things, but I think that pack is the part of Perl that I have managed to avoid the most. I've done socket IO, I've done forking, and I've skirted around the edges of threading. I've just never touched pack, and I feel like learning how to use it would break my head. That's fine, though. I wrote Number::Nary just for fun, not to get anything specific done. I'm sure not going to be generating Excel worksheet names again any time soon.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.