Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: I need Hex conversion, not!

by choroba (Abbot)
on Jan 07, 2013 at 13:31 UTC ( #1012031=note: print w/ replies, xml ) Need Help??


in reply to I need Hex conversion, not!

You can profit from the core Scalar::Util's dualvar:

#!/usr/bin/perl use warnings; use strict; { package DecHex; use Scalar::Util qw(dualvar); sub create { my $num = shift; my $string = sprintf '%X', $num; my $self = dualvar($num, $string); } } my $x = DecHex::create 0xFE; print "$x, ", 0+$x, "\n";
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: I need Hex conversion, not!
Select or Download Code
Re^2: I need Hex conversion, not!
by Anonymous Monk on Jan 07, 2013 at 17:34 UTC

    That is really nice, I think this is what I wanted, thank you.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012031]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-09-01 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (299 votes), past polls