develooper Front page | perl.perl5.porters | Postings from July 2020

Re: Announcing Perl 7

Thread Previous | Thread Next
From:
Karen Etheridge
Date:
July 4, 2020 04:28
Subject:
Re: Announcing Perl 7
Message ID:
CAPJsHfDC6ibOmF_nuTGeG-+eYdCiXH10NG91E7aM1KxMDVHVMA@mail.gmail.com
On Fri, Jul 3, 2020 at 6:14 PM Darren Duncan <darren@darrenduncan.net>
wrote:

> Personally I never understood why so many people write their file scope
> pragmas
> or non-symbol-installing package declarations within the current file's
> class
> declaration rather than before it.
>

I do:

    use strict;
    use warnings;
    package Foo;

..because I have tooling that inserts an 'our $VERSION = ...' declaration
into packages that are missing them, in the line immediately following the
package declaration, and perlcritic tends to complain if there is any code
that precedes a 'use strict'. It seems fairly natural to me to do it this
way, and it seems quite logical to place a 'use vX' declaration as early on
in the file as possible, as it would affect the parsing of that file (just
as 'use utf8' does).

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About