I'm trying to use perl to format weather data from a
postgres database. The trouble is that we store the
timezone information in the normal TZ environment variable
format (like EST5EDT for eastern US). In C, if I wanted to
get the local time at a particular place, I would do a
putenv call followed by a tzset call (this is on UNIX btw)
and then magically when I call localtime or mktime, I get
the effect I desire. I've done some searching, but I've
found no way to do something similar in Perl.
I've seen some references in my travels to the $ENV
variable. I assume that I can use that to set the timezone
given the strings from the database. If I do that, will
localtime cooperate and behave like it would in C? Is there
another way to do this?