Name : perl-Tie-TZ
| |
Version : 11
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp156.1.1
| Date : 2024-07-03 19:16:56
|
Group : Development/Libraries/Perl
| Source RPM : perl-Tie-TZ-11-lp156.1.1.src.rpm
|
Size : 0.06 MB
| |
Packager : https://www_suse_com/
| |
Summary : tied $TZ setting %ENV and calling tzset()
|
Description :
\'Tie::TZ\' provides a tied \'$TZ\' variable which gets and sets the TZ environment variable \'$ENV{\'TZ\'}\'. When it changes \'%ENV\', it calls \'tzset()\' (see POSIX) if available, ensuring the C library notices the change for subsequent \'localtime()\' etc.
$TZ = \'GMT\';
For a plain set, you can just as easily store and \'tzset()\' yourself (or have a function do the combination). The power of a tied variable comes when using \'local\' to have a different timezone temporarily. Any \'goto\', \'return\', \'die\', etc, exiting the block will restore the old setting, including a \'tzset()\' for it. See _examples/tie-tz.pl_ in the sources for complete program.
{ local $TZ = \'GMT\'; print ctime(); }
{ local $TZ = \'GMT\'; die \'Something\'; }
Storing \'undef\' to \'$TZ\' deletes \'$ENV{\'TZ\'}\' which unsets the environment variable. This generally means the timezone goes back to the system default (_/etc/timezone_ or wherever).
As an optimization, if a store to \'$TZ\' is already what \'$ENV{\'TZ\'}\' contains then \'POSIX::tzset()\' is not called. This is helpful if some of the settings you\'re using might be the same -- just store to \'$TZ\' and it notices when there\'s no change. If you never store anything different from the startup value then the \'POSIX\' module is not even loaded.
If \'tzset()\' is not implemented on your system then \'Tie::TZ\' just sets the environment variable. This is only likely on a very old or very limited C library. Of course setting the environment variable might or might not actually affect the timezone in force (see perlport/Time and Date).
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-T/15.6/x86_64 |