Skip Menu |

This queue is for tickets about the Data-Random-Contact CPAN distribution.

Report information
The Basics
Id: 85777
Status: open
Priority: 0/
Queue: Data-Random-Contact

People
Owner: Nobody in particular
Requestors: DOHERTY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.05
Fixed in: (no value)



Subject: Organization HQ address often incomplete
When generating lots of data, I'm getting much less complete information than I expected: $ perl -Ilib -MData::Random::Contact -MData::Dumper -MList::MoreUtils=any -E 'for (1..$ARGV[0]){my $org = Data::Random::Contact->new->organization; my $addr = $org->{address}->{headquarters}; warn Dumper $addr if any { !defined $addr->{$_} } qw/city region/; }' 1000 $VAR1 = { 'city' => undef, 'region_abbr' => 'AZ', 'postal_code' => undef, 'region' => 'Arizona', 'street_2' => undef, 'street_1' => undef }; $VAR1 = { 'city' => undef, 'region_abbr' => 'AZ', 'postal_code' => undef, 'region' => 'Arizona', 'street_2' => undef, 'street_1' => undef }; $VAR1 = { 'city' => undef, 'region_abbr' => undef, 'postal_code' => undef, 'region' => 'USA', 'street_2' => undef, 'street_1' => undef }; While it might technically be true that HQ is in "USA", that's not really an address. Did you intend to generate incomplete addresses like these?
Subject: Re: [rt.cpan.org #85777] Organization HQ address often incomplete
Date: Sun, 14 Jul 2013 23:18:48 -0500 (CDT)
To: Mike Doherty via RT <bug-Data-Random-Contact [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Fri, 31 May 2013, Mike Doherty via RT wrote: Show quoted text
> $ perl -Ilib -MData::Random::Contact -MData::Dumper -MList::MoreUtils=any -E 'for (1..$ARGV[0]){my $org = Data::Random::Contact->new->organization; my $addr = $org->{address}->{headquarters}; warn Dumper $addr if any { !defined $addr->{$_} } qw/city region/; }' 1000 > $VAR1 = { > 'city' => undef, > 'region_abbr' => 'AZ', > 'postal_code' => undef, > 'region' => 'Arizona', > 'street_2' => undef, > 'street_1' => undef > }; > $VAR1 = { > 'city' => undef, > 'region_abbr' => 'AZ', > 'postal_code' => undef, > 'region' => 'Arizona', > 'street_2' => undef, > 'street_1' => undef > }; > $VAR1 = { > 'city' => undef, > 'region_abbr' => undef, > 'postal_code' => undef, > 'region' => 'USA', > 'street_2' => undef, > 'street_1' => undef > }; > > While it might technically be true that HQ is in "USA", that's not really an address. Did you intend to generate incomplete addresses like these?
I actually think I _did_ intend to generate incomplete addresses, though having a region of "USA" seems wrong. That said, I haven't used htis module in a while, so I can't quite remember how it all works ;) -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/