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

RE: JPL - post 5.8.1

Thread Previous | Thread Next
From:
DeRykus, Charles E
Date:
November 11, 2004 08:58
Subject:
RE: JPL - post 5.8.1
Message ID:
5DF8FDE8DFE8744388602480FDCC0E310346FEC6@xch-nw-23.nw.nos.boeing.com
Another thanks to Patrick for the suggestion. I think
though that an updated core patch is really the way
to go (at least I get confused trying to wrap my mind
around an alternative since JPL embeds Perl in Java)

I'll take silence as a "patch update welcome" :)

Rgds,
--
Charles DeRykus

-----Original Message-----
From: Patrick LeBoutillier [mailto:patl@fusemail.com] 
Sent: Wednesday, November 10, 2004 7:13 AM
To: ced@carios2.ca.boeing.com
Cc: perl5-porters@perl.org; ab@corbomite.ca.boeing.com; jpl@perl.org
Subject: Re: JPL - post 5.8.1


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
>
>


Thread Previous | Thread Next


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