the hatter wrote:
This leads to some very handy shell aliases for finding out the time in new york / california.Yes, you're only setting the environment for the process that's executing. System picks a default $TZ that it hands to all processes spawned. If one of these is your shell, it'll inherit it, though you may have a login profile that changes it to something else before you see it. You can change $TZ in your shell, without affecting the parent. You run perl, it inherits the environment (and thus $TZ) from your shell, or if you've not tinkered with it, from the system. You can change $TZ in perl, when the program finishes, its enviroment is discarded. While you program is running, the shell still keeps its original $TZ, regardless of what the program changes (and thus any oter programs it starts while your perl one is running will also get the shells settings, not those of the perl process)
% alias | grep date
estdate='TZ=EST5EDT date'
pstdate='TZ=PST8PDT date'
-Dom
--
| Semantico: creators of major online resources |
| URL: http://www.semantico.com/ |
| Tel: +44 (1273) 722222 |
| Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |