in reply to Re: Header file management
in thread Header file management

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,

Replies are listed 'Best First'.
Re^3: Header file management
by shmem (Chancellor) on Apr 30, 2018 at 10:11 UTC
    (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,
Re^3: Header file management
by smaines (Novice) on Apr 30, 2018 at 17:00 UTC

    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

Re^3: Header file management
by swl (Prior) on Apr 30, 2018 at 09:52 UTC

    Thanks choroba, that's useful to know.