in reply to Re^6: File-scoped lexicals and eval scope?
in thread File-scoped lexicals and eval scope?
That does raise an interesting question as to what code a perl optimiser would be allowed to remove. You'd really like the optimiser to be able to nuke code like this:
if the constant evaluated to 0. I guess if $somevar was relevant to the debugging then it would be closed over anyway, but that is a bit too subtle.while (tight_loop) { write_to_log("Some msg involving $somevar") if REALLY_HEAVY_DEBUG; some_more_code(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: File-scoped lexicals and eval scope?
by ysth (Canon) on Nov 12, 2007 at 08:52 UTC |