in reply to Re^5: Problem with regexp or saved match variable.
in thread Problem with regexp or saved match variable.

Also, the difficulty of using local (in any of its grammatical forms) without wanting to imply the local function frustrates me, and confuses me when others do so without being explicit.

The following passage from perlsyn is an example that mislead me, and I suspect others, until I realized that local means local but localized means my and localization refers ambiguously to both local or my. It is very difficult for me not to see the local function all three times - I trip on this every time I read the passage.

The "foreach" loop iterates over a normal list value and sets the variable VAR to be each element of the list in turn. If the variable is preceded with the keyword "my", then it is lexically scoped, and is therefore visible only within the loop. Otherwise, the variable is implicitly local to the loop and regains its former value upon exiting the loop. If the variable was previously declared with "my", it uses that variable instead of the global one, but it’s still localized to the loop. This implicit localisation occurs only in a "foreach" loop.
  • Comment on Re^6: Problem with regexp or saved match variable.