Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re^3: regex issue

by CountZero (Bishop)
on Mar 24, 2004 at 22:04 UTC ( #339564=note: print w/replies, xml ) Need Help??


in reply to Re^3: regex issue
in thread regex issue

No, no, that's cheating.

You cannot predeclare my ($A,$B) as you are not supposed to know what's in the data-file. It could be any variable name and any value.

However, the eval suggestion is a good one. How about:

$name ='A'; $value =10; $string = 'my $' . $name . '=' . $value . '; print "result inside eval +: $A\n";'; eval ($string) or die "ERROR: $@"; print "result outside eval: $A\n";

As can be expected the lexical declaration does not survive outside of the eval though :-(

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://339564]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2022-01-27 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (70 votes). Check out past polls.

    Notices?