File Coverage

blib/lib/Data/Faker/StreetAddress.pm
Criterion Covered Total %
statement 30 30 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod n/a
total 40 40 100.0


line stmt bran cond sub pod time code
1             package Data::Faker::StreetAddress;
2 2     2   10 use strict;
  2     2   5  
  2         69  
  2         11  
  2         5  
  2         608  
3 2     2   9 use warnings;
  2     2   5  
  2         60  
  2         10  
  2         4  
  2         60  
4 2     2   11 use vars qw($VERSION); $VERSION = '0.10';
  2     2   4  
  2         103  
  2         9  
  2         5  
  2         94  
5 2     2   9 use base 'Data::Faker';
  2     2   5  
  2         183  
  2         10  
  2         3  
  2         69  
6 2     2   667 use Data::Faker::Name;
  2     2   5  
  2         18  
  2         24  
  2         5  
  2         12  
7              
8             =head1 NAME
9              
10             Data::Faker::StreetAddress - Data::Faker plugin
11              
12             =head1 SYNOPSIS AND USAGE
13              
14             See L
15              
16             =head1 DATA PROVIDERS
17              
18             =over 4
19              
20             =item us_zip_code
21              
22             Return a random zip or zip+4 zip code in the US zip code format. Note that
23             this is not necessarily a valid zip code, just a 5 or 9 digit number in the
24             correct format.
25              
26             =cut
27              
28             __PACKAGE__->register_plugin(
29             us_zip_code => ['#####','#####-####'],
30             );
31              
32             =item us_state
33              
34             Return a random US state name.
35              
36             =cut
37              
38              
39             __PACKAGE__->register_plugin(
40             us_state => [
41             qw{
42             Alabama Alaska Arizona Arkansas California Colorado Connecticut
43             Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas
44             Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota
45             Mississippi Missouri Montana Nebraska Nevada Ohio Oklahoma Oregon
46             Pennsylvania Tennessee Texas Utah Vermont Virginia Wisconsin
47             Wyoming Washington
48             },
49             'New Hampshire', 'New Jersey', 'New Mexico', 'New York',
50             'North Carolina', 'North Dakota', 'Rhode Island', 'South Carolina',
51             'South Dakota', 'West Virginia',
52             ],
53             );
54              
55             =item us_state_abbr
56              
57             Return a random US state abbreviation. (Includes US Territories and AE, AA,
58             AP military designations.)
59              
60             From the USPS list at http://www.usps.com/ncsc/lookups/usps_abbreviations.html
61             =cut
62              
63             __PACKAGE__->register_plugin(
64             us_state_abbr => [qw(
65             AL AK AS AZ AR CA CO CT DE DC FM FL GA GU HI ID IL IN IA KS KY
66             LA ME MH MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND MP OH OK
67             OR PW PA PR RI SC SD TN TX UT VT VI VA WA WV WI WY AE AA AP
68             )],
69             );
70              
71             =item street_suffix
72              
73             Return a random street suffix (Drive, Street, Road, etc.)
74              
75             From the USPS list at http://www.usps.com/ncsc/lookups/usps_abbreviations.html
76              
77             =cut
78              
79             __PACKAGE__->register_plugin(
80             street_suffix => [qw(
81             Alley Avenue Branch Bridge Brook Brooks Burg Burgs Bypass Camp Canyon
82             Cape Causeway Center Centers Circle Circles Cliff Cliffs Club Common
83             Corner Corners Course Court Courts Cove Coves Creek Crescent Crest
84             Crossing Crossroad Curve Dale Dam Divide Drive Drive Drives Estate
85             Estates Expressway Extension Extensions Fall Falls Ferry Field Fields
86             Flat Flats Ford Fords Forest Forge Forges Fork Forks Fort Freeway
87             Garden Gardens Gateway Glen Glens Green Greens Grove Groves Harbor
88             Harbors Haven Heights Highway Hill Hills Hollow Inlet Inlet Island
89             Island Islands Islands Isle Isle Junction Junctions Key Keys Knoll
90             Knolls Lake Lakes Land Landing Lane Light Lights Loaf Lock Locks Locks
91             Lodge Lodge Loop Mall Manor Manors Meadow Meadows Mews Mill Mills
92             Mission Mission Motorway Mount Mountain Mountain Mountains Mountains
93             Neck Orchard Oval Overpass Park Parks Parkway Parkways Pass Passage
94             Path Pike Pine Pines Place Plain Plains Plains Plaza Plaza Point Points
95             Port Port Ports Ports Prairie Prairie Radial Ramp Ranch Rapid Rapids
96             Rest Ridge Ridges River Road Road Roads Roads Route Row Rue Run Shoal
97             Shoals Shore Shores Skyway Spring Springs Springs Spur Spurs Square
98             Square Squares Squares Station Station Stravenue Stravenue Stream
99             Stream Street Street Streets Summit Summit Terrace Throughway Trace
100             Track Trafficway Trail Trail Tunnel Tunnel Turnpike Turnpike Underpass
101             Union Unions Valley Valleys Via Viaduct View Views Village Village
102             Villages Ville Vista Vista Walk Walks Wall Way Ways Well Wells
103             )],
104             );
105              
106             =item street_name
107              
108             Return a fake street name.
109              
110             =cut
111              
112              
113             __PACKAGE__->register_plugin(
114             street_name => [
115             '$last_name $street_suffix',
116             '$first_name $street_suffix',
117             ],
118             );
119              
120             =item street_address
121              
122             Return a fake street address.
123              
124             =cut
125              
126             __PACKAGE__->register_plugin(
127             street_address => [
128             '##### $street_name',
129             '##### $street_name',
130             '##### $street_name',
131             '##### $street_name',
132             '##### $street_name Apt. ###',
133             '##### $street_name Suite ###',
134             '##### $street_name \####',
135             '##### $secondary_unit_designator',
136             ],
137             );
138              
139             =item secondary_unit_designator
140              
141             Return a random secondary unit designator, with a range if needed (secondary
142             unit designators are things like apartment number, building number, suite,
143             penthouse, etc that differentiate different units with a common address.)
144              
145             =cut
146              
147             __PACKAGE__->register_plugin(
148             secondary_unit_designator => [
149             'Apartment $secondary_unit_number',
150             'Building $secondary_unit_number',
151             'Department $secondary_unit_number',
152             'Floor #', 'Floor ##', 'Floor ###',
153             'Floor \##', 'Floor \###', 'Floor \####',
154             'Hangar $secondary_unit_number',
155             'Lot $secondary_unit_number',
156             'Pier $secondary_unit_number',
157             'Room $secondary_unit_number',
158             'Slip $secondary_unit_number',
159             'Space $secondary_unit_number',
160             'Stop $secondary_unit_number',
161             'Suite $secondary_unit_number',
162             'Trailer $secondary_unit_number',
163             'Unit $secondary_unit_number',
164             'Basement','Front','Lobby','Lower','Office',
165             'Penthouse','Rear','Side','Upper',
166             ],
167             );
168              
169             =item secondary_unit_number
170              
171             Return a random secondary unit number, for the secondary unit designators that
172             take ranges.
173              
174             =cut
175              
176             __PACKAGE__->register_plugin(
177             secondary_unit_number => [
178             ('A' .. 'Z'), '###','\####','##','\###','#','\##',
179             '#-A','\##-A','#-B','\##-B','#-C','\##-C','#-D','\##-D','#-E','\##-E',
180             '#-F','\##-F','#-G','\##-G','#-H','\##-H','#-I','\##-I','#-J','\##-J',
181             ],
182             );
183              
184             =item city
185              
186             Return a random city, taken from a list of larger cities in several U.S. states.
187              
188             =cut
189              
190             __PACKAGE__->register_plugin(
191             city => [
192             'Agoura Hills',
193             'Akron',
194             'Alameda',
195             'Alhambra',
196             'Aliso Viejo',
197             'Anaheim',
198             'Anchorage',
199             'Apple Valley',
200             'Arcadia',
201             'Artesia',
202             'Ashland',
203             'Athens',
204             'Atwater',
205             'Auburn',
206             'Avalon',
207             'Azusa',
208             'Bakersfield',
209             'Baldwin Park',
210             'Barrow',
211             'Bell Gardens',
212             'Bell',
213             'Bellflower',
214             'Bentonville',
215             'Berkeley',
216             'Bessemer',
217             'Beverly Hills',
218             'Birmingham',
219             'Bloomington',
220             'Blythe',
221             'Bowling Green',
222             'Bradbury',
223             'Brea',
224             'Buena Park',
225             'Burbank',
226             'Burlingame',
227             'Calabasas',
228             'Canton',
229             'Carson',
230             'Cerritos',
231             'Chandler',
232             'Chico',
233             'Chino Hills',
234             'Chino',
235             'Chula Vista',
236             'Cincinnati',
237             'Citrus Heights',
238             'City of Industry',
239             'Claremont',
240             'Cleveland',
241             'Columbus',
242             'Commerce',
243             'Compton',
244             'Concord',
245             'Corona',
246             'Costa Mesa',
247             'Covina',
248             'Covington',
249             'Crown Point',
250             'Cudahy',
251             'Culver City',
252             'Cypress',
253             'Daly City',
254             'Dana Point',
255             'Danville',
256             'Dayton',
257             'Decatur',
258             'Delta Junction',
259             'Demopolis',
260             'Diamond Bar',
261             'Dothan',
262             'Downey',
263             'Duarte',
264             'El Cerrito',
265             'El Monte',
266             'El Segundo',
267             'Elkhart',
268             'Escondido',
269             'Eufaula',
270             'Eureka',
271             'Evansville',
272             'Fairbanks',
273             'Fairfield',
274             'Fayetteville',
275             'Flagstaff',
276             'Florence',
277             'Florence',
278             'Fontana',
279             'Forrest City',
280             'Fort Smith',
281             'Fort Wayne',
282             'Fountain Valley',
283             'Frankfort',
284             'Fremont',
285             'Fresno',
286             'Fullerton',
287             'Gadsden',
288             'Garden Grove',
289             'Gardena',
290             'Gary',
291             'Gilbert',
292             'Glendale',
293             'Glendale',
294             'Glendora',
295             'Gulf Shores',
296             'Half Moon Bay',
297             'Hamilton',
298             'Hammond',
299             'Hawaiian Gardens',
300             'Hawthorne',
301             'Hayward',
302             'Hermosa Beach',
303             'Hidden Hills',
304             'Hollister',
305             'Hollywood',
306             'Homer',
307             'Hoover',
308             'Hope',
309             'Hopkinsville',
310             'Hot Springs',
311             'Huntington Beach',
312             'Huntington Park',
313             'Huntsville',
314             'Indianapolis',
315             'Indio',
316             'Inglewood',
317             'Irvine',
318             'Irwindale',
319             'Jasper',
320             'Jeffersontown',
321             'Jonesboro',
322             'Juneau',
323             'Kent',
324             'Ketchikan',
325             'Kettering',
326             'Kokomo',
327             'La CaƱada Flintridge',
328             'La Habra Heights',
329             'La Habra',
330             'La Jolla',
331             'La Mirada',
332             'La Palma',
333             'La Puente',
334             'La Verne',
335             'Lafayette',
336             'Laguna Beach',
337             'Laguna Hills',
338             'Laguna Niguel',
339             'Laguna Woods',
340             'Lake Forest',
341             'Lakewood',
342             'Lakewood',
343             'Lancaster',
344             'Lawndale',
345             'Lexington',
346             'Lima',
347             'Little Rock',
348             'Lodi',
349             'Lomita',
350             'Long Beach',
351             'Los Alamitos',
352             'Los Angeles',
353             'Louisville',
354             'Lynwood',
355             'Malibu',
356             'Manhattan Beach',
357             'Marana',
358             'Maywood',
359             'Mentor',
360             'Mentor-on-the-Lake',
361             'Merced',
362             'Mesa',
363             'Michigan City',
364             'Middletown',
365             'Mission Viejo',
366             'Mobile',
367             'Modesto',
368             'Monrovia',
369             'Montebello',
370             'Monterey Park',
371             'Monterey',
372             'Montgomery',
373             'Moraga',
374             'Moreno Valley',
375             'Muncie',
376             'Murray',
377             'Murrieta',
378             'Nenana',
379             'Newport Beach',
380             'Nogales',
381             'Nome',
382             'North Little Rock',
383             'North Pole',
384             'Norwalk',
385             'Oakland',
386             'Ontario',
387             'Orange',
388             'Oro Valley',
389             'Owensboro',
390             'Oxford',
391             'Oxnard',
392             'Paducah',
393             'Palm Springs',
394             'Palmdale',
395             'Palo Alto',
396             'Palos Verdes Estates',
397             'Paramount',
398             'Parma',
399             'Pasadena',
400             'Peoria',
401             'Phenix City',
402             'Phoenix',
403             'Pico Rivera',
404             'Pine Bluff',
405             'Placentia',
406             'Pomona',
407             'Prescott',
408             'Rancho Cordova',
409             'Rancho Cucamonga',
410             'Rancho Palos Verdes',
411             'Rancho Santa Margarita',
412             'Redding',
413             'Redlands',
414             'Redondo Beach',
415             'Rialto',
416             'Richmond',
417             'Riverside',
418             'Rohnert Park',
419             'Rolling Hills Estates',
420             'Rolling Hills',
421             'Rosemead',
422             'Roseville',
423             'Sacramento',
424             'Sahuarita',
425             'Salinas',
426             'San Bernardino',
427             'San Clemente',
428             'San Diego',
429             'San Dimas',
430             'San Fernando',
431             'San Francisco',
432             'San Gabriel',
433             'San Jose',
434             'San Juan Capistrano',
435             'San Luis Obispo',
436             'San Marino',
437             'San Mateo',
438             'San Rafael',
439             'Santa Ana',
440             'Santa Barbara',
441             'Santa Clara',
442             'Santa Clarita',
443             'Santa Cruz',
444             'Santa Fe Springs',
445             'Santa Monica',
446             'Santa Rosa',
447             'Scottsdale',
448             'Seal Beach',
449             'Selma',
450             'Seward',
451             'Sierra Madre',
452             'Sierra Vista',
453             'Signal Hill',
454             'Simi Valley',
455             'Sitka',
456             'Sonoma',
457             'South Bend',
458             'South El Monte',
459             'South Gate',
460             'South Pasadena',
461             'Springdale',
462             'Springfield',
463             'Stanton',
464             'Steubenville',
465             'Stockton',
466             'Sunnyvale',
467             'Sutter Creek',
468             'Temecula',
469             'Tempe',
470             'Temple City',
471             'Terre Haute',
472             'Texarkana',
473             'Thousand Oaks',
474             'Tok',
475             'Toledo',
476             'Torrance',
477             'Troy',
478             'Tucson',
479             'Tuscaloosa',
480             'Tuskegee',
481             'Tustin',
482             'Two Rivers',
483             'Union City',
484             'Valdez',
485             'Valencia',
486             'Vallejo',
487             'Valparaiso',
488             'Ventura',
489             'Vernon',
490             'Villa Park',
491             'Vincennes',
492             'Visalia',
493             'Walnut',
494             'West Covina',
495             'West Hollywood',
496             'West Lafayette',
497             'West Memphis',
498             'Westlake Village',
499             'Westminster',
500             'Whittier',
501             'Wynne',
502             'Yorba Linda',
503             'Youngstown',
504             'Yuma',
505             'Zanesville',
506             ],
507             );
508              
509             =back
510              
511             =head1 SEE ALSO
512              
513             L
514              
515             =head1 AUTHOR
516              
517             Jason Kohles, Eemail@jasonkohles.comE
518              
519             =head1 COPYRIGHT AND LICENSE
520              
521             Copyright 2004-2005 by Jason Kohles
522              
523             This library is free software; you can redistribute it and/or modify
524             it under the same terms as Perl itself.
525              
526             =cut
527              
528             1;