Yes, this works! but only if I set $ENV{TEMP} within the Perl script that calls File::Temp::tempfile():

12:25 >set TEMP=. 12:25 >set TEMP TEMP=. 12:26 >perl -T -MFile::Temp=tempfile -wE "say $ENV{TEMP}; tempfile();" . Error in tempfile() using template \XXXXXXXXXX: Could not create temp +file \JFwYM0_6Kz: Permission denied at -e line 1. 12:26 >perl -T -MFile::Temp=tempfile -wE "$ENV{TEMP} = '.'; say $ENV{T +EMP}; tempfile();" . 12:26 >

So, I can get the tests for MooseX::App::Cmd to pass by hacking t/basic.t like this:

SKIP: { my $have_TO = eval { require Test::Output; 1; }; print STDERR $@; skip 'these tests require Test::Output', 5 unless $have_TO; local @ARGV = qw(commands); my $temp = $ENV{TEMP}; # ADDED $ENV{TEMP} = '.'; # ADDED my ($output) = Test::Output::output_from( sub { $cmd->run } ); $ENV{TEMP} = $temp; # ADDED for my $name (qw(commands frobulate justusage stock bark)) { like( $output, qr/^\s+\Q$name\E/sm, "$name plugin in listing" +); } }

But I still don’t have a way to tweak the environment so that MooseX::App::Cmd installs “out of the box.”

Thanks for the help,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


In reply to Re^4: File::Temp::tempfile() fails under taint mode by Athanasius
in thread File::Temp::tempfile() fails under taint mode by Athanasius

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.