use Carp; sub get_zip { my $self = shift; my $city = uc(+shift) || croak "No city given"; my $state = uc(+shift) || croak "No state given"; my $zip = $self->single({ city_name => $city, state_abbr => $state }, { columns => [qw/zip_code/] } ); if ( $zip ) { return $zip->zip_code; } else { carp "No ZIP found for city_name:$city and state_abbr:$state"; } return undef; }