I haven't fully researched all possible consequences of the proceeding
code snippet but I have used something similar to it in some of my
Mason pages with success.
perl -e 'use strict;use warnings;my $a="foo";my $b="a";eval "print \$${b}";'
As you can see, strict and warnings stay on.
On 11 Mar 2006 16:41:23 -0800, Randal L. Schwartz <[email protected]> wrote:
> >>>>> "Bradley" == Bradley C Bailey <[EMAIL PROTECTED]> writes:
>
> >> Karjala wrote:
> >>> Is it not possible?
> >>
> >> I read it's possible to disable the use strict in Mason with a
> >> parameter, but that would have other consequences too (like harder error
> >> checking)
> >>
> >> Is there a way to enable ${$a} but not disable strict;
> >>
>
> Bradley> Try adding a "no strict;" line to your component's <%init> block to
> Bradley> disable the pragma for only that component. I've never tested this,
> so I
> Bradley> do not know if it will work or not.
>
> But you really really really don't want to do this.
>
> If you ever get to the point where you're asking "how do I turn a string
> into a variable name?", you've gone down the wrong tunnel. No cheese
> at the end of that tunnel. Back up, try a different strategy.
>
> Really.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <[email protected]> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users