This repository was archived by the owner on Mar 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
74 lines (52 loc) · 1.99 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
NAME
Phone::Number - Module to hold a phone number from a UK-centric point of
view.
head1 VERSION
Version 1.0.0
SYNOPSYS
use Phone::Number;
my $num = new Phone::Number('02002221666');
print $num->formatted; # 020 0222 1666
print $num->packed; # 02002221666
print $num->number; # +442002221666
print $num->plain; # 442002221666
print $num->uk ? "yes" : "no"; # yes
EXPORT
Nothing is exported
ROUTINES
new
Creates a new, immutable object using any unambiguous phone number
format.
my $num = new Phone::Number('02002221666');
my $num = new Phone::Number('2002221666');
my $num = new Phone::Number('442002221666');
my $num = new Phone::Number('+442002221666');
my $new = new Phone::Number($num);
formatted
Returns the number formatted with leading 0 and spaces.
This can be used for displaying the number in "standard" format.
packed
Returns the number with a leading 0 but no spaces.
This can be useful for databases but see plain below.
number
Returns the number in international format starting with +.
plain
Returns the number in international format without the +.
This is usually the best way to store the number onto a database.
uk
Returns a boolean: true if it is a valid UK number
AUTHOR
Cliff Stanford, `<cpan@may.be>'
BUGS
Please report any bugs or feature requests to `bug-phone-number at
rt.cpan.org', or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Phone-Number. I will be
notified, and then you'll automatically be notified of progress on your
bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Phone::Number
LICENSE AND COPYRIGHT
Copyright 2014 Cliff Stanford.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.