2 Jul 2011 18:17
Re: new package syntax, where do I return true?
Caleb Cushing <xenoterracide <at> gmail.com>
2011-07-02 16:17:25 GMT
2011-07-02 16:17:25 GMT
On Sat, Jul 2, 2011 at 1:13 AM, Flavio Poletti <flavio <at> polettix.it> wrote: > i.e. it advices you to return a true value from the *file*, not from the > package. This seems to be confirmed by require's documentation: > > The file must return true as the last statement to indicate > successful execution of any initialization code, so it's > customary to end such a file with "1;" unless you're sure > it'll > return true otherwise. But it's better just to put the "1;", > in case you add more statements. > > Again, we're talking about the file, not any package inside. > > At this point, we could argue that putting the "1;" inside the block makes > the whole code return a true value... but considering that the "1;" is > file-related and that it seems difficult to handle properly in Perl::Critic, > is this worth a crusade? probably not, but I thought that this was the package that needed to be returned true from and not the file. Now I understand. Thanks. -- -- Caleb Cushing http://xenoterracide.com
RSS Feed