in reply to How can I get a single record from Google Contacts based on a phone number?
Interaction with Google contacts can be accomodated with WWW::Google::Contacts (or this if CPAN search is down).
Checking the number is likely accomplished with mangling the input into a regular expression; perhaps like:
or, following your suggested specmy @terms = $ARGV[0] =~ /(\d{3})(\d{3})(\d{4})/; my $re = qr/^\(?$terms[0]\)?-?$terms[1]-?$terms[2]$/;
If you are unfamiliar with regular expressions, see perlretut.$number =~ s/[^\d:]//g; if (grep $_ eq $ARGV[0], split ':::', $number) { say $number; }
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I get a single record from Google Contacts based on a phone number?
by Anonymous Monk on Mar 27, 2015 at 01:13 UTC | |
|
Re^2: How can I get a single record from Google Contacts based on a phone number?
by Anonymous Monk on Mar 27, 2015 at 08:12 UTC | |
by hippo (Archbishop) on Mar 27, 2015 at 10:52 UTC | |
by einhverfr (Friar) on Mar 27, 2015 at 09:18 UTC |