in reply to Re: Bitwise operators
in thread Bitwise operators

Hi again, thevoid,

I just now read this earlier post of yours.

    print "$value & 1", "$Value & 2", "$value & 4";

The problem you're having is that you can only interpolate a certain amount within strings, and doing bit-wise arithmetic is a little too much.

You could do this if you used printf like so:
printf "%d, %d, %d, ", $value & 1, $value & 2, $value & 4;

And you could even convert to one or zero values by applying the appropriate shifts:

printf "%d, %d, %d, ", ($value & 1), ($value & 2) >> 1, ($value & 4) > +> 2;

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^3: Bitwise operators
by thevoid (Scribe) on Dec 25, 2006 at 22:14 UTC
    Hi, just spotted this!

    That's pretty nifty also : )