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. 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. Finally, 1 is a boring value to return. Be creative! See http://returnvalues.useperl.at/values.html -- Paul Johnson - p...@pjcj.net -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/