davies has asked for the wisdom of the Perl Monks concerning the following question:
Long ago, I remember reading some definitions. From memory, they were:
I thought I had found a bug, but it turns out that it is documented. I have two files.
Master.pl
use strict; use warnings; use diagnostics; use slave; $slave::typo = "Hello world"; print "$slave::typo\n";
slave.pm
use strict; use warnings; use diagnostics; package slave; 1;
This surprised me by working when I expected a compile time error. The docs say (my italics):
This generates a compile-time error if you access a variable that wasn't declared via our or use vars, localized via my(), or wasn't fully qualified.
So it's a feature, not a bug, but it's not a feature I like, as I'm just as capable of making typos in fully qualified names as in unqualified names. I tried use dominatrix, but that failed. Is there anything that will report the use of undeclared fully qualified variable names?
Regards,
John Davies
Back to
Seekers of Perl Wisdom