<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@petra.bz" />
</head>

<body>



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="#String::Validator-Methods-and-Usage">String::Validator Methods and Usage</a></li>
  <li><a href="#Methods-Specific-to-String::Validator::Phone::NANP">Methods Specific to String::Validator::Phone::NANP</a>
    <ul>
      <li><a href="#Parameters-to-New-with-default-behaviour">Parameters to New with (default) behaviour.</a></li>
      <li><a href="#Original-String-International-Areacode-Parens-Exchange-Local">Original, String, International, Areacode, Parens, Exchange, Local</a></li>
      <li><a href="#Number_Phone">Number_Phone</a></li>
    </ul>
  </li>
  <li><a href="#Example">Example</a></li>
  <li><a href="#ToDo">ToDo</a></li>
  <li><a href="#AUTHOR">AUTHOR</a></li>
  <li><a href="#SUPPORT">SUPPORT</a></li>
  <li><a href="#Bug-Reports-and-Patches">Bug Reports and Patches</a></li>
  <li><a href="#ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</a></li>
  <li><a href="#LICENSE-AND-COPYRIGHT">LICENSE AND COPYRIGHT</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>String::Validator::Phone::NANP - Check a Phone Number (North American Numbering Plan)!</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<p>String::Validator::Phone::NANP is part of the String Validator Collection. It checks a string against validation rules for phone numbers from countries participating in the North American Numbering Plan, which includes the United States and Canada.</p>

<h1 id="String::Validator-Methods-and-Usage">String::Validator Methods and Usage</h1>

<p>Provides and conforms to the standard String::Validator methods, please see String::Validator for general documentation, and String::Validator::Common for information on the base String::Validator Class.</p>

<h1 id="Methods-Specific-to-String::Validator::Phone::NANP">Methods Specific to String::Validator::Phone::NANP</h1>

<h2 id="Parameters-to-New-with-default-behaviour">Parameters to New with (default) behaviour.</h2>

<pre><code> alphanum    (OFF) : Allow Alphanumeric formats.</code></pre>

<h2 id="Original-String-International-Areacode-Parens-Exchange-Local">Original, String, International, Areacode, Parens, Exchange, Local</h2>

<p>Returns:</p>

<p>Original: the Orignial string provided,</p>

<p>String: the internal representations of the phone number, which is in the format of AREA-EXCHANGE-NUMBER, (the most commonly used representation in the United States).</p>

<p>International: Prepends 1- in front of the string.</p>

<p>Areacode, Exchange, Local: Returns each of the 3 components of a number</p>

<p>Parens: Formats the number (AREA) EXCHANGE-LOCAL.</p>

<h2 id="Number_Phone">Number_Phone</h2>

<p>Returns a Number::Phone::NANP object based on the current phone number, if the last number evaluated was not valid it returns 0.</p>

<h1 id="Example">Example</h1>

<pre><code> use String::Validator::Phone::NANP ;
 my $Validator = String::Validator::Phone::NANP-&gt;new( alphanum =&gt; 1 ) ;

 if ( $Validator-&gt;IsNot_Valid( &#39;6464&#39;) { say $Validator-&gt;Errstr() }
 # IsNot_Valid returns Errstr on failure.
 # So the preceding and following are the same.
 my $badone = $Validator-&gt;IsNot_Valid( &#39;999&#39;) ;
 if ( $badone ) { say &quot;$badone&#39; } ;

 if ( $Validator-&gt;Is_Valid( &#39;646-SG7-6464&#39; ) { say &quot;good&quot; }
 say $Validator-&gt;Areacode ; # print the Areacode.
 my $PhoneNum = $Validator-&gt;Number_Phone ; # Get a Number Phone object.
 say $PhoneNum-&gt;country; # Prints the two letter country code of the number.</code></pre>

<h1 id="ToDo">ToDo</h1>

<p>The major TO DO items are to provide String::Validator::Phone modules for other numbering schemes and to fully encapsulate Number::Phone.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>John Karr, <code>&lt;brainbuz at brainbuz.org&gt;</code></p>

<h1 id="SUPPORT">SUPPORT</h1>

<p>You can find documentation for this module with the perldoc command.</p>

<pre><code>    perldoc String::Validator::Phone</code></pre>

<h1 id="Bug-Reports-and-Patches">Bug Reports and Patches</h1>

<p>Please submit Bug Reports and Patches via https://github.com/brainbuz/String-Validator.</p>

<h1 id="ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</h1>

<h1 id="LICENSE-AND-COPYRIGHT">LICENSE AND COPYRIGHT</h1>

<p>Copyright 2012 John Karr.</p>

<p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or at your option any later version.</p>

<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>

<p>A copy of the GNU General Public License is available in the source tree; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</p>


</body>

</html>