use Base; $hex = new Base 16 => 'FF'; print $hex; # Stringify # FF print $hex->binary; # Return value only ($hex->binary is an alias for $hex->base 2) # 11111111 print $hex; # FF print $hex->to_binary; # Change value # 11111111 print $hex; # 11111111