Evaluating small snippet of script

Discussion in 'Perl Misc' started by xiaomitao@gmail.com, May 29, 2006.

  1. Guest

    use strict;

    eval {
    $var_name = "varName";
    $$var_name = "Hello World";
    print $varName;
    }

    How can i "use strict" for the entire program but not for this code
    snippet?

    Thanks!
     
    , May 29, 2006
    #1
    1. Advertising

  2. <> wrote:
    > use strict;
    >
    > eval {


    no strict;

    > $var_name = "varName";
    > $$var_name = "Hello World";
    > print $varName;
    > }
    >
    > How can i "use strict" for the entire program but not for this code
    > snippet?



    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, May 29, 2006
    #2
    1. Advertising

  3. Tintin Guest

    <> wrote in message
    news:...
    > use strict;
    >
    > eval {
    > $var_name = "varName";
    > $$var_name = "Hello World";
    > print $varName;
    > }
    >
    > How can i "use strict" for the entire program but not for this code
    > snippet?


    By rewriting your code to use a hash instead.



    *** Posted via a free Usenet account from http://www.teranews.com ***
     
    Tintin, May 30, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hagay Lupesko

    Evaluating url trust level

    Hagay Lupesko, Oct 19, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    368
    Hagay Lupesko
    Oct 19, 2003
  2. microsoft.private.windows.netserver.setup

    Evaluating Formulas in ASP.NET

    microsoft.private.windows.netserver.setup, Mar 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    379
    Steve C. Orr [MVP, MCSD]
    Mar 4, 2004
  3. Torsten Mohr
    Replies:
    0
    Views:
    93
    Torsten Mohr
    Dec 17, 2003
  4. mike

    Firefox not evaluating a script

    mike, Feb 24, 2006, in forum: Javascript
    Replies:
    3
    Views:
    111
  5. Replies:
    2
    Views:
    175
Loading...

Share This Page