Changeset 3919 for src/perl5/perl5.c

Show
Ignore:
Timestamp:
05/26/05 23:10:37 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
5482
Message:

* marshall pugs execution environment into $pugs::env.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/perl5/perl5.c

    r3918 r3919  
    190190 
    191191SV * 
    192 perl5_eval(char *code, int cxt) 
     192perl5_eval(char *code, SV *env, int cxt) 
    193193{ 
    194194    dSP; 
    195     SV* sv = newSVpv(code, 0); 
    196  
     195    SV* sv; 
     196 
     197    ENTER; 
     198 
     199    if (env != NULL) { 
     200        sv = get_sv("pugs::env", 1); 
     201        save_item(sv); 
     202        sv_setsv(sv, env); 
     203    } 
     204 
     205    sv = newSVpv(code, 0); 
    197206    eval_sv(sv, cxt); 
    198207    SvREFCNT_dec(sv); 
     
    200209    SPAGAIN; 
    201210    sv = POPs; 
    202     PUTBACK; 
     211    SvREFCNT_inc(sv); 
     212    PUTBACK; 
     213 
     214    FREETMPS; 
     215    LEAVE; 
    203216 
    204217    return sv;