in reply to Re^3: DateTime->now problem
in thread DateTime->now problem

XS SV = IV(0xa26f58) at 0xa26f60 REFCNT = 1 FLAGS = (ROK) RV = 0xa26f48 SV = REGEXP(0xa67418) at 0xa26f48 REFCNT = 1 FLAGS = (OBJECT,POK,FAKE,pPOK) IV = 0 PV = 0xa75e90 "(?-xism:^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)$)" CUR = 36 LEN = 0 STASH = 0xa0b8f0 "Regexp" SV = IV(0xa26f58) at 0xa26f60 REFCNT = 1 FLAGS = (ROK) RV = 0xa26f48 SV = REGEXP(0xa67418) at 0xa26f48 REFCNT = 2 FLAGS = (OBJECT,POK,FAKE,pPOK) IV = 0 PV = 0xa75e90 "(?-xism:^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)$)" CUR = 36 LEN = 0 STASH = 0xa0b8f0 "Regexp" 'regex' validation parameter for 'N/A must be a string or qr// regex at monktest.pl line 25

Replies are listed 'Best First'.
Re^5: DateTime->now problem
by ikegami (Patriarch) on Apr 01, 2011 at 21:58 UTC
    Identical to me. I don't know how you could be getting that error. The code in question is
    if ((temp = hv_fetch(spec, "regex", 5, 0))) { dSP; IV has_regex = 0; IV ok; SvGETMAGIC(*temp); if (SvPOK(*temp)) { has_regex = 1; } else if (SvROK(*temp)) { SV* svp; svp = (SV*)SvRV(*temp); #if PERL_VERSION <= 10 if (SvMAGICAL(svp) && mg_find(svp, PERL_MAGIC_qr)) { has_regex = 1; } #else if (SvTYPE(svp) == SVt_REGEXP) { has_regex = 1; } #endif } if (!has_regex) { SV* buffer; buffer = sv_2mortal(newSVpv("'regex' validation parameter +for '", 0)); sv_catsv(buffer, get_called(options)); sv_catpv(buffer, " must be a string or qr// regex\n"); FAIL(buffer, options); }

    You can probably get around the problem by using the pure Perl backend. You can do that by setting environment variable PV_TEST_PERL to something true.

    PV_TEST_PERL=1 perl script.pl
    or
    BEGIN { $ENV{PV_TEST_PERL} = 1; }

      Appears to be working. At this point I don't care about the elegance of the solution, I would rather just not have to come in this weekend to recode these scripts. Thanks for all your help ikegami

        A cleaner solution might be to delete (or rename) the file returned by

        echo $(dirname $(perldoc -l Params::Validate))/../auto/Params/Validate +/Validate.so

        It's very broken, so you don't want to use it, and P::V will fall back on the pure Perl solution.