Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Probably an easy one - store command in variable.

by Joost (Canon)
on Sep 15, 2005 at 16:58 UTC ( [id://492331]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Probably an easy one - store command in variable.
in thread Probably an easy one - store command in variable.

Just a nit-pick; string eval does not start a new perl interpreter, although it does need to compile the $string every time the eval statement is executed, which usually makes it slow compared to alternative strategies.

There are also some subtle issues and bugs with eval $string and scoping, but you're unlikely to run into them if you use eval $string sparingly. update: as nobull states: in this particular case, you've ran into one such issue: a lexical variable declared inside a string eval is not available outside of the eval statement :-)

  • Comment on Re^3: Probably an easy one - store command in variable.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found