laziness, impatience, and hubris | |
PerlMonks |
Re: warnings pragma anomalyby muba (Priest) |
on Oct 19, 2015 at 17:23 UTC ( [id://1145344]=note: print w/replies, xml ) | Need Help?? |
Another place where using 1 in void context is commonplace is near/at the end of modules. When use Foo loads Foo.pm, then the last expression evaluated inside Foo.pm better be a true value, to signal that the module loaded succesfully. That's why you usually see the line near or at the end of a .pm file. Because 1 evaluates to a true value, but is special-cased not to raise a warning.
In Section
Seekers of Perl Wisdom
|
|