...and localtime will give me the time in UTC. However win32 (Windows Vista with strawberry Perl 5.10.1 to be precise) steadfastly refuses to give me anything except the local time. Though funnily enough, if I do:

...at the windows command prompt, then print scalar localtime will be in UTC. So there has to be some way to do this in perl but what is it?

(Some background. My module Module::Starter::Plugin::CGIApp creates a bunch of files. One of these has a time stamp created with localtime. In
my test suite I compare the modules output against a set of known good files. However as the value of localtime keeps changing, I need to force a fixed time in the test script. I use Test::MockTime for this which almost works except for this time zone issue.)

I had a similar problem with an application that had to return local times for multiple timezones.
An easy enough way to do this is to use the DateTime module.
To convert a known time to another time, you can use:

I dimly remember once having had a similar issue, which - IIRC - was solved by re-exec-ing the program after having changed the environment variable (not entirely sure though — can't find the code and don't have a Windows system to try at the moment...)