Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • use Tie::Formatted;
    printf "This is hex: $format{12, 18, 35, 42, '%02x'}\n";
    prints
    This is hex: 0c 12 23 2a
    Plus if you prefer a different name for the magic hash:
    use Tie::Formatted qw(f);
    print "$f{142857, '%08x'}\n";
    gives
    00022e09
    There. :)