in reply to Re: question of pack.
in thread question of pack.

Hi thevoid,

If you read the documentation, you'll see that oct is capable of conversion from binary.  It just requires putting a leading '0b' in front of the number.

For example:

use strict; use warnings; my $value = "0b101010"; printf "$value is %d decimal\n", oct($value);

Not too long ago, I even wrote a submission about it, in which I admitted that I didn't know about this additional functionality of oct until much later in my Perl education.

As for your other question, to make links clickable, you can do this:  [id://591504], which will appear like "Bitwise operators" in the rendered page.

See Writeup Formatting Tips and Perl Monks Approved HTML tags for more information.

Update:  Fixed a transcription typo.


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

Replies are listed 'Best First'.
Re^3: question of pack.
by thevoid (Scribe) on Dec 26, 2006 at 15:42 UTC
    Hi liverpole, thanks for the info.