develooper Front page | perl.perl5.porters | Postings from November 2004

Re: JPL - post 5.8.1

From:
Patrick LeBoutillier
Date:
November 10, 2004 07:55
Subject:
Re: JPL - post 5.8.1
Message ID:
64171.206.162.172.138.1100099580.fusewebmail-20072@www.fusemail.com
Hi all,

I don't know much about JPL, but I was faced with this problem a while
back with my
Inline::Java project. I managed to overcome the problem by copying the
environment
myself before calling perl_parse:

    char *args[] = {"inline-java", "-e1"} ;
    int envl = 0 ;
    int i = 0 ;
    char **envdup = NULL ;

    /* This will leak, but it's a one shot... */
    for (i = 0 ; environ[i] != NULL ; i++){
        envl++ ;
    }
    envdup = (char **)calloc(envl + 1, sizeof(char *)) ;
    for (i = 0 ; i < envl ; i++){
        envdup[i] = strdup(environ[i]) ;
    }

    interp = perl_alloc() ;
    perl_construct(interp) ;
    perl_parse(interp, xs_init, 2, args, envdup) ;
    perl_run(interp) ;

It seemed to work for me without having to patch or
recompile perl (but maybe my perl was already patched? I use
just a standard RedHat 9.0 perl).

Maybe this soultion be applied to JPL?


Patrick

----- Original Message -----
>
> Is there any chance of Jarkko's core patch for JPL (Larry's
> Java Perl Lingo) making it back into core..?
>
>  History:  Java (jdk 1.2+) stopped tolerating Perl's environment
>  diddling so Jarkko wrote a patch to just dup the environment so
>  Perl can diddle its private copy. Java was happy because the
>  original env was remained pristine, JPL kept working, and all
>  was right with the world.
>
> The original patch made into 5.6.1 but not in subsequent
> versions that I can detect since I don't see the JPL or
> NEED_DUP_ENVIRON_FOR_MODIFY defines. Jarkko updated the
> patch for 5.8.1 and it's working there. However, I wonder
> if its not making the cut after 5.6.1 was oversight or
> deliberate euthanasia...
>
> We're worried that Jarkko's 5.8.1 patch will eventually stop
> working altogether as Perl marches on. JPL's heavily used
> here in several large legacy Java applications so its loss
> would cause major pain. A couple of us would gladly act as
> custodians for the code and try to pitch in in whatever way
> we're able.
>
> Rgds,
> --
> Charles DeRykus
>
>




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About