in reply to Re: Best way to represent somewhat large values in a module
in thread Best way to represent somewhat large values in a module

Thanks for your thoughts, tachyon.
You say you are converting to hex but then go on to say And using pack and unpack makes them unprintable, which is annoying.
Right, I meant that's why I'm converting to hex instead of using pack and unpack. Those whole-string bit operations look pretty tempting, though...Perhaps the right thing to do is only convert to and from hex when I get data from the user, and store the data as bitstrings, using code like the above. Hmmm...

Replies are listed 'Best First'.
Re^3: Best way to represent somewhat large values in a module
by tachyon (Chancellor) on Jun 19, 2004 at 10:16 UTC

    There are some 'gotchas' when you do $str BIT_OP $str but for things like masks you should be OK. Sometimes it works like you expect, other times not. It is fairly magical that it works at all!

    cheers

    tachyon