in reply to warnings pragma anomaly
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.1;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: warnings pragma anomaly
by choroba (Cardinal) on Oct 19, 2015 at 17:40 UTC | |
by BrowserUk (Patriarch) on Oct 19, 2015 at 21:59 UTC | |
by choroba (Cardinal) on Oct 19, 2015 at 22:25 UTC | |
by muba (Priest) on Oct 19, 2015 at 23:22 UTC | |
by choroba (Cardinal) on Oct 20, 2015 at 07:45 UTC | |
by BrowserUk (Patriarch) on Oct 19, 2015 at 22:40 UTC |
In Section
Seekers of Perl Wisdom