BernieC has asked for the wisdom of the Perl Monks concerning the following question:

Summary of where I'm at: I've been on a quest for tzset. I have been trying to install SVG::TT::Graph and when I do it bombs out with
t/02_basic.t ........... 1/85 POSIX::tzset not implemented on this architecture at blib/lib/SVG/TT/Graph/TimeSeries.pm line 582, <DATA> line 593. # Looks like your test exited with 255 just after 72.
and apparently that error is correct, since I found over on stackexchange
TL;DR: Starting with Perl v5.8.9 (released in 2011) calling tzset when changing $ENV{TZ} isn't needed anymore.
The actual culprit is SVG::TT::Graph::TimeSeries. Which has
Format string for presenting the X axis labels. The POSIX strftime() function is used for formatting after calling the POSIX tzset() function with the timezone specified in timescale_time_zone if present (see strftime man pages and LC_TIME locale information).
Any suggestions of what the right thing to do is? Should I contact the author of SVG::TT::Graph::TimeSeries and point out the problem? I don't think CPAN is like wikipedia and i can change it myself and make an updated version.

I have the .pm code here and so I suppose I could edit the offending call out of it and just install it locally. But I don't know how version-tracking and such goes. Here's the code in SVG::TT::Graph::TimeSeries:

# Need to set the timezone in order for x-axis labels to be # formatted correctly by strftime: $ENV{'TZ'} = $self->{config}->{timescale_time_zone}; POSIX::tzset();
one "#" edited into the file and a config and gmake and I *think* I'd have a local copy that'd work. But what would the cpan database think? It thinks I have v1.88, but I can't find the version number anywhere in the .pm file. I'm just not sure what to do about this.

Replies are listed 'Best First'.
Re: tzset and POSIX
by haukex (Archbishop) on Jan 30, 2020 at 19:56 UTC

    Looking at the CPAN Testers Matrix, the tests on Windows started failing in 1.02, although the tzset call was introduced in 1.01. However, the changes between 1.01 and 1.02 are so minimal (just one patch) that unless that bug is affecting you, you could just as well install 1.01, or comment out the offending tzset line. But I'd definitely also file an issue with the maintainer, since this is clearly a regression on Windows.

Re: tzset and POSIX
by BernieC (Pilgrim) on Jan 31, 2020 at 15:05 UTC
    I did what I think was the simplest thing to do: I submitted a bug report to Strawberry. And this morning I received an email
    After v5.8.9 I don't believe the use of tzset should be required. Reference:https://perldoc.pl/perl589delta

    The FAQs make not reference to tzset: https://perldoc.pl/perlfaq8#How-do-I-set-the-time-and-date? Context: https://perlmonks.org/?node_id=11112025

    I'll supply a patch to SVG::TT::Graph::XY shortly to resolve this issue.

    So, in a while the problem will be solved!

        Oh, right, there was a whole subthread about this issue already... BernieC: Please link to previous threads if they're related.

        Did I do something wrong? I just tried again and got the same error:
        t/02_basic.t ........... 1/85 POSIX::tzset not implemented on this architecture at blib/lib/SVG/TT/Graph/TimeSeries.pm line 582, <DATA> line 593. # Looks like your test exited with 255 just after 72.