Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Number-Phone CPAN distribution.

Report information
The Basics
Id: 72507
Status: resolved
Priority: 0/
Queue: Number-Phone

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.9
Fixed in: (no value)



Subject: Get the canonical msisdn back out of the object?
After constructing a Number::Phone object, how can I get the canonical number back out? There is no $obj->number interface, despite this field being implemented in some subclasses, and data does not seem to be stored consistently across subclasses, even if I wanted to poke into the object beyond the APIs, which I don't consider safe. e.g. for UK numbers, it appears that the number itself is blessed as the object: perl -MNumber::Phone -MData::Dumper -wle'my $obj = Number::Phone->new("+44 2087 712 924"); print Dumper($obj)' $VAR1 = bless( do{\(my $o = '+442087712924')}, 'Number::Phone::UK' ); PS. It would also be enormously helpful if there was a string overload on the object to access the number, e.g. for printing error messages: my $num = Number::Phone->new("+44 2087 712 924"); die "Cannot use this number $num!"; (see perldoc overload for how to set this up.)
The ->format() method should do what you want