"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
(Following up on a brief CB /msg exchange, that may be interesting to other monks.)
Speaking of documentation only here: I thought "executed within the context of the current Perl program" ought to have trumped eval EXPR's move to main, but as ikegami notes, the statement about context applies only to eval BLOCK. But eval BLOCK of course does share some (a lot of) state with the main program; there's no new perl interpreter constructed, and the following does change the value of $x in the main program: perl -le '$x = 42; eval q($x = 6*9); print $x' # prints "54" The first thing that needs fixing in this case appears to be the docs. In reply to Re^2: eval('__PACKAGE__') is always main?!!!
by gaal
|
|