in reply to Re^2: Package declaration in code block
in thread Package declaration in code block

If you're posting example code, it's useful for everything to be in one self-contained example file, so that people can just copy and paste it into their editor and run it, rather than them having to create a directory called Foo and make a file in there called Bar.pm and paste some code in there, and then create another folder called Boo and make a file in there called Far.pm and paste more code in there, and then...

use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Replies are listed 'Best First'.
Re^4: Package declaration in code block
by McA (Priest) on Apr 23, 2014 at 16:57 UTC

    That's a very good argument. I haven't thought about that.

    But this is the "More-than-one-package-per-file"-case. I was wondering if there is a reason to do so in a package per file.

    Regards
    McA

      I was wondering if there is a reason to do so in a package per file.

      Probably obedience to some style guide :)

      Or proper laziness -- if copy/paste works, why edit to unindent...