in reply to strict/do question
1. do $file is like eval `cat $file`, except the former
- searches @INC and updates %INC.
- bequeaths an *unrelated* lexical scope on the eval'ed code.
The lexical scope is unrelated. So, the my variable of one file is that file's variable (that's what 'my' means). Use our in both files, and your script will run fine with use strict and work like expected.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: strict/do question
by dch (Initiate) on Nov 24, 2006 at 14:20 UTC |