Hi Paul,

On Wed, 5 Feb 2014 11:37:08 +0000
Paul Johnson <[email protected]> wrote:

> On Wed, Feb 05, 2014 at 10:51:56AM +0100, Manfred Lotz wrote:
> > Hi all,
> > Perl 5.14 allows package blocks.
> > 
> > Assume i have a file Hello.pm
> > 
> > package Hello; {
> >   ...
> > 
> >   1;
> > }
> > # or better here
> > # 1;
> > 
> > 
> > My question is: Would I put 1; inside the { } or should I put it
> > outside the { }.
> 
> If you are programming nicely, that is you only have the single
> package in the file, then it doesn't matter.  However, it is the file
> that needs to return true and so it is better to put the true value
> as the very last statement in the file.
> 

Yep, Shlomi also said this. I agree. 


> Also, you'll want to delete the semicolon on the package declaration
> line.  What you have currently is an old-style package declaration and
> then an ordinary block, meaning that anything after the block is also
> in package Hello.
> 

Yep, taken.


> Finally, 1 is a boring value to return.  Be creative!
> See http://returnvalues.useperl.at/values.html
> 

This is really funny.


-- 
Thanks,
Manfred


-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to