You can't preform method calls within a regular expression unless you
specify an 'e' modifier flag on the end. For instance:
my $two =3D 1;
$two =3D s/1/1+1/e;
print $two; # prints "2"
In your case, you need something like:
s{_TS_(.+_)}{$m->cache->get('_TS_'.$1.$lang)}eg
Brian
On 4/28/06, Christian Motschke <motschke@...> wrote:
>
> Hello,
>
> I try to access the cache from a filter section. I theory it works, but I
> get a strange output:
>
>
> MasonX::Request::WithApacheSession=3DHASH(0x8d50dfc)->cache->get('_TS_'.M=
ENU_SPRACHE_.en)
>
> What do I wrong?
>
> My component looks like this:
>
> _TS_MENU_SPRACHE_en
>
> <%args>
> $lang =3D> 'en'
> </%args>
>
> <%init>
> my $result =3D $m->cache->get('_TS_MENU_SPRACHE_en');
> if (!defined($result)) {
> $m->cache->set('_TS_MENU_SPRACHE_en','Language Page');
> $m->cache->set('_TS_MENU_SPRACHE_de','Sprachseite');
> }
> </%init>
>
> <%filter>
> s{_TS_(.+_)}{$m->cache->get('_TS_'.$1.$lang)}g;
> </%filter>
>
> mit freundlichen Gr=FC=DFen
> Christian Motschke
>
> --
> IT Service Omikron GmbH
> Mohrenstr. 63-64; D-10117 Berlin
> Tel.: +49 (030) 220791-30
> Fax: +49 (030) 220791-55
> Email: motschke@...
> Internet: http://www.itso.de
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim=
o
> http://sel.as-us.falkag.net/sel?cmdlnk&kid=120709&bid&3057&dat=121642
> _______________________________________________
> Mason-users mailing list
> Mason-users@...
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
|