Code snippet:
my $tz = DateTime::TimeZone->new(name => 'America/San_Francisco'); This immediately dies because America/San_Francisco is not a recognized timezone.
The following message is printed:
The timezone 'America/San_Francisco' could not be loaded, or is an invalid name.
I would like to handle this error and print additional info for the user before the script exits. I tried using unless, but no luck catching the die.
How can this be done?