sub is_pg_date_error { my $key = shift; my $value = param($key); if ($DBI::errstr =~ m/Bad date external representation '$value'/o) { error(title=>'Inproper date format', msg=>"There is a problem with $key field. Please return and format it in the format YYYY-MM-DD and confirm that it is a valid date.") } }