in reply to $^X not set in mod_perl

$^X is defined to be "The name that the Perl binary itself was executed as". In the case of mod_perl, perl was never executed; it was simply called as a library. You can simply set $^X like any other variable before calling Date_Init. "perl -le '$^X=31; print $^X'" works as expected (on my system, at lest: 5.6.1 on a UNIX box).

Better, though, would be to figure out a way to have Date::Manip::Date_Init uses $^X at all; it would seem to have no good reason. Indeed, it uses it to check if taint is on. A better way to do that would be to check if somthing you know will be tainted is tainted useing the recipie in perlsec. (My suggestion would be to use a backtick for somthing like `echo`, or the return from readdir(), or some file input. Or hardwire it (if you do, you should have it to assume that taint checking is _off_, so if you accedently run it with them off, it's not a gaping hope.)

TACCTGTTTGAGTGTAACAATCATTCGCTCGGTGTATCCATCTTTG ACACAATGAATCTTTGACTCGAACAATCGTTCGGTCGCTCCGACGC

Replies are listed 'Best First'.
Re: Re: $^X not set in mod_perl
by rdfield (Priest) on Jan 31, 2002 at 16:25 UTC
    Yep, setting $^X manually does the trick. As with all the best/simplest answers..."why didn't I think of that?" :)

    Many thanks,

    rdfield