# automatically generated file, don't edit



# Copyright 2011 David Cantrell, derived from data from libphonenumber
# http://code.google.com/p/libphonenumber/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package Number::Phone::StubCountry::VA;
use base qw(Number::Phone::StubCountry);

use strict;
use warnings;
use utf8;
our $VERSION = 1.20150718142141;

my $formatters = [];
my $validators = {'fixed_line' => '06698\\d{5}','mobile' => '3(?:[12457-9]\\d{8}|6\\d{7,8}|3\\d{7,9})','toll_free' => '80(?:0\\d{6}|3\\d{3})','voip' => '55\\d{8}','personal_number' => '1(?:78\\d|99)\\d{6}','pager' => '','geographic' => '06698\\d{5}','special_rate' => '(84(?:[08]\\d{6}|[17]\\d{3}))|(0878\\d{5}|1(?:44|6[346])\\d{6}|89(?:2\\d{3}|4(?:[0-4]\\d{2}|[5-9]\\d{4})|5(?:[0-4]\\d{2}|[5-9]\\d{6})|9\\d{6}))'};sub areaname { my $self = shift; my $number = $self->{number}; my %map = (39010 => "Genoa",39011 => "Turin",390122 => "Turin",390125 => "Turin",390131 => "Alessandria",390141 => "Asti",39015 => "Biella",390161 => "Vercelli",390165 => "Aosta\ Valley",390166 => "Aosta\ Valley",390171 => "Cuneo",390183 => "Imperia",390185 => "Genoa",390187 => "La\ Spezia",3902 => "Milan",39030 => "Brescia",39031 => "Como",390321 => "Novara",390322 => "Novara",390324 => "Verbano\-Cusio\-Ossola",390331 => "Varese",390332 => "Varese",390341 => "Lecco",390342 => "Sondrio",390343 => "Sondrio",390344 => "Como",390346 => "Bergamo",39035 => "Bergamo",390362 => "Cremona\/Monza",390363 => "Bergamo",390364 => "Brescia",390365 => "Brescia",390371 => "Lodi",390372 => "Cremona",390373 => "Cremona",390376 => "Mantua",390382 => "Pavia",39039 => "Monza",39040 => "Trieste",39041 => "Venice",390421 => "Venice",390422 => "Treviso",390423 => "Treviso",390424 => "Vicenza",390425 => "Rovigo",390426 => "Rovigo",390432 => "Udine",390444 => "Vicenza",390445 => "Vicenza",39045 => "Verona",390461 => "Trento",390471 => "Bolzano\/Bozen",390481 => "Gorizia",39049 => "Padova",39050 => "Pisa",39051 => "Bologna",390521 => "Parma",390522 => "Reggio\ Emilia",390523 => "Piacenza",390532 => "Ferrara",390541 => "Rimini",390543 => "Forlì\-Cesena",390545 => "Ravenna",390549 => "San\ Marino",39055 => "Florence",390565 => "Livorno",390574 => "Prato",390575 => "Arezzo",390577 => "Siena",390583 => "Lucca",390585 => "Massa\-Carrara",390586 => "Livorno",39059 => "Modena",3906 => "Rome",39070 => "Cagliari",39071 => "Ancona",390731 => "Ancona",390732 => "Ancona",390733 => "Macerata",390734 => "Fermo",390735 => "Ascoli\ Piceno",390737 => "Macerata",39075 => "Perugia",390774 => "Rome",390776 => "Frosinone",390783 => "Oristano",390789 => "Sassari",39079 => "Sassari",39080 => "Bari",39081 => "Naples",390823 => "Caserta",390824 => "Benevento",390825 => "Avellino",390832 => "Lecce",39085 => "Pescara",390862 => "L\'Aquila",390865 => "Isernia",390874 => "Campobasso",390881 => "Foggia",390882 => "Foggia",390883 => "Andria\ Barletta\ Trani",390884 => "Foggia",39089 => "Salerno",39090 => "Messina",39091 => "Palermo",390921 => "Palermo",390922 => "Agrigento",390924 => "Trapani",390925 => "Agrigento",390933 => "Caltanissetta",390934 => "Caltanissetta\ and\ Enna",390942 => "Catania",39095 => "Catania",390961 => "Catanzaro",390962 => "Crotone",390963 => "Vibo\ Valentia",390965 => "Reggio\ Calabria",390974 => "Salerno",390975 => "Potenza",39099 => "Taranto",);
      foreach my $prefix (map { substr($number, 0, $_) } reverse(1..length($number))) {
        return $map{"39$prefix"} if exists($map{"39$prefix"});
      }
      return undef;
    }
sub new {
  my $class = shift;
  my $number = shift;
  $number =~ s/(^\+39|\D)//g;
  my $self = bless({ number => $number, formatters => $formatters, validators => $validators }, $class);
  return $self->is_valid() ? $self : undef;
}

1;
