I've learned something new today
Along the same line of thought, you may be interested in Math::BaseCnv
#!/usr/bin/perl
use warnings;
use strict;
use Math::BaseCnv;
#fast
# Convert 63 from base-10 (decimal) to base-2 (binary)
# $binary_63 = cnv( 63, 10, 2 );
my $time = time;
print "time -> $time\n";
my $time_128 = cnv( $time, 10, 128 );
print "time_128 -> $time_128\n";
#this will sometimes print hidden newlines
my $time_10 = cnv( $time_128, 128, 10 );
print "time_10 -> $time_10\n";
my $time_64 = cnv( $time, 10, 64 );
print "time_64 -> $time_64\n";
my $time_b64 = cnv( $time, 10, 'b64' );
print "time_b64 -> $time_b64\n";
exit;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.