Richard Nuttall wrote:
This coupling makes me nervous. A number is a number: its value is not effected by its representation.How aboutmy $a = 256:192.169.34.76; my $b = $a.base(10); my $c = '34:13.23.0.1.23.45'.base(16);
I can see that, in some scripts, it might be useful to define a property such that:
my $a = 26 but string_fmt("%02x"); # == ("%16.02r")
print $a, "$a", ~$a, sprintf("%s", +$a);
would print "26 1a 1a 26" (without the spaces).
However, I would not like to see such a property set by default. It has the potential to cause too many surprises for the unsuspecting recipient
of a number, who suddenly finds it behaves in funny ways.
Dave.