Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello Pascal666 The until BLOCK enters a new lexical scope. When used in BLOCK form. When used as a statement modifier the scope has not entered into a BLOCK. The lexical scope is at the file level so there is no need for strict to complain. I was going to suggest using the feature state but this does not change the problem. It does however allow scoping to take place within the block Variables lexically scoped with my will be initialised, then get undefined when leaving the scope. As the scope is the body of a loop this re-occurs each iteration Variables lexically scoped with state will be initialsed but with enough mana to last till the scope exits at the completion of the loop, whence they will meet their timely fate. Change the state and my declarations in the following code, but if you use both my, make sure to uncomment the last three lines of the loop.
Edited main scope to say file scope, re LanX In reply to Re: Missing error under strict
by Don Coyote
|
|