Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: What is the difference between eval and do?

by ELISHEVA (Prior)
on Feb 19, 2011 at 21:36 UTC ( #889106=note: print w/ replies, xml ) Need Help??


in reply to What is the difference between eval and do?

Note: I wrote this and only after realized that I didn't read eliya's answer carefully enough. Consider this an amplification of his final paragraph.

There is a very nice summary of the difference in the documentation for do - see the second example for do EXPR.

One of the biggest differences is that the code run by eval can "see" the value of my variables in the code surrounding it. When do "some file" executes the code in a file, that code lives in its own world and cannot access those variables.


Comment on Re: What is the difference between eval and do?
Select or Download Code
Re^2: What is the difference between eval and do?
by AGhoulDoingPerl (Sexton) on Feb 20, 2011 at 05:41 UTC
    and this too, thanks:)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-08-30 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls