in reply to Re^2: "possible typo" warnings in modules
in thread "possible typo" warnings in modules
UPDATE added example
For instance this will stop at compile time:
#!/usr/bin/perl use strict; use warnings; use lib '.'; use WarnMe; print "1\n"; print $WarnMe::val,"\n"; print "2\n";
outputs:package WarnMe; use strict; use warnings; # syntax error my $val = $Some:Nonexistent::Pkg::variable; 1;
zentara@:zentara$ ./WarnMe Global symbol "$Some" requires explicit package name at WarnMe.pm line + 7. syntax error at WarnMe.pm line 7, near "$Some:" Compilation failed in require at ./WarnMe line 5. BEGIN failed--compilation aborted at ./WarnMe line 5.
Clearly the Perl compiler is checking syntax first. If you fix that syntax error, the script will compile and run with issuing a non-fatal runtime error:
Name "WarnMe::val" used only once: possible typo at ./WarnMe line 8. 1 Use of uninitialized value in print at ./WarnMe line 8. 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: "possible typo" warnings in modules
by diotalevi (Canon) on Feb 17, 2007 at 19:27 UTC | |
by zentara (Cardinal) on Feb 17, 2007 at 19:47 UTC | |
by diotalevi (Canon) on Feb 17, 2007 at 20:51 UTC | |
by Joost (Canon) on Feb 17, 2007 at 20:55 UTC |