in reply to Bitwise operators

I'm not sure whether you are looking to solve this problem in any way, or solve it in the particular way they suggest. If the former, sprintf is probably the easiest way; if the latter, you can find out the value of individual bits of $value with $value & 1, $value & 2, $value & 4, $value & 8, etc., and form a string of "0"s and "1"s based on those.

Replies are listed 'Best First'.
Re^2: Bitwise operators
by thevoid (Scribe) on Dec 24, 2006 at 22:07 UTC
    Yeah, that looks like the the way they meant. The tutorial I'm doing is good in some ways, but occasionally there seems to be too large a gap between what has been demonstrated and what I'm asked to do. So if I can't do it the exact way that was intended I'm happy to find another solution, I'm sure I'll come across all the different ways of going about things anyway the further I get in to Perl.
      I'm sure I'll come across all the different ways of going about things anyway the further I get in to Perl.
      Actually, probably not. Perl has lots of nooks and crannies that most people never need to venture into. But that's OK. From the Programming Perl 3rd ed. preface:
      Most important, you don't have to know everything there is to know about Perl before you can write useful programs. You can learn Perl "small end first". You can program in Perl Baby-Talk, and we promise not to laugh. Or more precisely, we promise not to laugh any more than we'd giggle at a child's creative way of putting things. Many of the ideas in Perl are borrowed from natural language, and one of the best ideas is that it's okay to use a subset of the language as long as you get your point across. Any level of language proficiency is acceptable in Perl culture. We won't send the language police after you. A Perl script is "correct" if it gets the job done before your boss fires you.
        that's cool, I definitely like the idea that one of Perl's major strengths is its flexibility
        Like the sound of that, reassuring to know update: oops, just realised that I've replied twice, still getting the hang of this board haha