I was bugged by the fact that this works on Linux but not FreeBSD so I spent some time poking at a VM.

What I think is going on is that Date::Manip::TZ tries to get the time zone in a few different ways and finally uses shell commands. I think it probably uses files on Linux but winds up running a shell command on FreeBSD. Since $ENV{ENV} is defined on FreeBSD, we get...

$ perl -T -MDate::Manip::DM6 -E 'say $Date::Manip::VERSION' Insecure $ENV{ENV} while running with -T switch at /usr/local/lib/perl +5/site_perl/Date/Manip/TZ.pm line 844.
The line that provokes the error is
open(IN,$cmd |") || return ();

I believe the answer is that you need to clean up $ENV{ENV} but I suppose that might also be something that Date::Manip::TZ should be doing.

If worse comes to worst, there seem to be a lot of ways to configure the time zone so maybe you can find one that avoids the shell.

FWIW, the old version 5 interface doesn't have this problem.

$ DATE_MANIP=DM5 perl -T -MDate::Manip -E 'say $Date::Manip::VERSION' 6.81

2020-06-21 Athanasius changed "Data::Manip::TZ" link to "Date::Manip::TZ".


In reply to Re: Date::Manip and taint mode by Anonymous Monk
in thread Date::Manip and taint mode by byfr81

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.