|
|
| "be consistent" | |
| PerlMonks |
Where does the spurious error message come from?by kikuchiyo (Hermit) |
| on Aug 04, 2023 at 13:40 UTC ( [id://11153704]=perlquestion: print w/replies, xml ) | Need Help?? |
|
kikuchiyo has asked for the wisdom of the Perl Monks concerning the following question: I've come across a strange case while refactoring some code at $work. This is a minimal example:
This program is of course broken, $undeclared_variable is, true to its name, undeclared. However, when ran with perl 5.36.1, I get the following error messages:
The first error message is valid, the second, however, is not. That line is fine, and indeed if you uncomment the variable declaration in foo(), the program runs without errors or warnings. So where does the spurious error message come from? Does the presence of the first error push the interpreter in a state where the magic brace-guessing heuristics is broken?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||