in reply to Header file management

You could adapt the approach used in Modern::Perl (as one example).

As for not having the 1; at the end of the file, that's needed by the system. It can be any true value, though, so you could replace it with something amusing/interesting if that's your preference.

Update shortly after posting. See Perl Module ending without 1; for a description of why it is needed, as well as listing and linking to some alternate endings.

Replies are listed 'Best First'.
Re^2: Header file management
by choroba (Cardinal) on Apr 30, 2018 at 09:48 UTC
    The semicolon isn't required, just the true value :-) In my opinion, removing the semicolon prevents you (or other maintainers of the package) from adding more lines below the final line as it would probably cause a syntax error. (I don't write semicolons after return and die etc. for the same reasons.)

    I usually use

    __PACKAGE__

    at the end of a package. Each module on successful use then returns its own name which should be true unless you plan to name your module 0.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      (I don't write semicolons after return and die etc. for the same reasons.)

      This is only useful if they are positioned at the very end of a scope. Used as argument to statement modifiers without ending semicolon causes a syntax error at compile time, unless you put the semicolon at the beginning of the following line.

      Or is it that I didn't get what you mean? in that case, please show me a working example.

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
        Modified return and die still need the semicolon, of course. If they aren't modified, they should be at the very end of scope, and that's the point.

        For an example, see my PerlMonks ChatterBox client.

        ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      I've decided to do it your way (__PACKAGE__). I also realized from your post that I was doing the one-semicolon thing wrong anyway. =D

      Thanks again,

      -SM

      Thanks choroba, that's useful to know.