Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Evaluating small snippet of script

Reply
Thread Tools

Evaluating small snippet of script

 
 
xiaomitao@gmail.com
Guest
Posts: n/a
 
      05-29-2006
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!

 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      05-29-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> 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
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
Tintin
Guest
Posts: n/a
 
      05-30-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> 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 ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Evaluating SCRIPT block in DHTML: document.write() problem ethandbrown@gmail.com Javascript 2 06-25-2006 04:21 PM
Firefox not evaluating a script mike Javascript 3 02-25-2006 03:19 AM
Evaluating Formulas in ASP.NET microsoft.private.windows.netserver.setup ASP .Net 1 03-04-2004 08:59 AM
executing perl script (as char*, not file) in C and evaluating @ARGV Torsten Mohr Perl Misc 0 12-17-2003 10:25 PM
Evaluating url trust level Hagay Lupesko ASP .Net 0 10-19-2003 07:27 PM



Advertisments