generates these errors:#!/your/perl/here use strict; use warnings; if (( 1) # missing closing paren { my $x; ($x) = 'abc' =~ /(b)/; $x++; }
In the real code, several variables (which had been declared outside of the if block) were referenced, and were reported as "masking".C:\Perl\perl>perl -c syntax_error2.pl "my" variable $x masks earlier declaration in same scope at syntax_err +or2.pl line 9. "my" variable $x masks earlier declaration in same scope at syntax_err +or2.pl line 10. syntax error at syntax_error2.pl line 7, near ") # missing closing par +en {" syntax error at syntax_error2.pl line 11, near "}" syntax_error2.pl had compilation errors.
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re^2: Grokking Compile Error Messages (details)
by QM
in thread Grokking Compile Error Messages
by QM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |