[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl-dev
Subject:    Re: [mp2] refactor perldo in modperl_cmd.c
From:       Stas Bekman <stas () stason ! org>
Date:       2004-02-14 4:25:08
Message-ID: 402DA324.4090701 () stason ! org
[Download RAW message or body]

Stas Bekman wrote:
[...]

> +    eval_pv(apr_psprintf(p, "{ local $0 = q[%s]; %s }",
> +                         directive->filename, arg), FALSE);

I've figured that if the above works, why can't we do the same in C API. So 
I've digged in and learned that save_item doesn't handle magic. So here is a 
short and sweet solution that works:

     {
         GV *gv = gv_fetchpv("0", TRUE, SVt_PV);
         ENTER;
         save_scalar(gv);
         sv_setpv_mg(GvSV(gv), directive->filename);
         eval_pv(arg, FALSE);
         LEAVE;
     }

now committed.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic