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";
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
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.