Perl500503Syntax-OrDie

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    4. Installs CORE::GLOBAL:: overrides that enforce correct runtime
       behaviour for open() and mkdir().

    String and regex contents are intentionally not inspected: a string
    literal may contain any text (including keywords such as "say" or
    format flags such as "%v") without triggering a violation, because
    those are runtime values, not syntax constructs.

    No source-filter infrastructure (Filter::Util::Call, etc.) is
    required or used.  The module itself runs on every Perl from
    5.005_03 through the current release.

PROGRAMMATIC API
    check_source($source, $label)
        Scans $source (a string) and returns a list of violation strings.
        Returns an empty list when no violations are found.  Does NOT die
        automatically; the caller decides what to do with the list.

            my @v = Perl500503Syntax::OrDie::check_source($src, 'foo.pl');
            if (@v) { warn $_ for @v }

    check_file($path)
        Reads $path and calls check_source.  Dies with the violation list
        if any violations are found; returns normally otherwise.

CHECKED CONSTRUCTS
  Static (compile-time)
    Perl 5.6
      our $var / our @arr / our %hash      (use "use vars" instead)
      open(FH, MODE, PATH)                 3-argument form
      use utf8
      use VERSION  where VERSION >= 5.6
      use vVERSION where VERSION >= v5.6
      \x{HHHH}                             Unicode hex escape
      \N{name}                             Named character escape
      @+ / @-  and  $+[N] / $-[N]         Match-position arrays
      CHECK { } / INIT { }                 Phase blocks
      v1.2.3                               v-string notation
      $^V                                  Version object (use $] instead)
      sub foo :lvalue { }                  :lvalue attribute
      *name{SLOT}                          Typeglob component access
      \p{} / \P{}                          Unicode property in regex

    Perl 5.8
      use encoding
      use constant { A => 1, B => 2 }      Multi-constant hashref form

    Perl 5.10
      //=                                  Defined-or assignment
      //                                   Defined-or operator (standalone)
      say                                  (->say() method calls excluded)
      state $var
      given(...) / when(...)
      ~~                                   Smart-match
      use feature
      \K                                   Keep in regex
      (?<name>...) / \k<name>              Named capture/backreference
      (?|...)                              Branch reset group
      (*VERB)                              Backtrack control verb
      \h \H \v \V \R                       Whitespace escapes in regex
      UNITCHECK { }                        Phase block
      a++ / a*+ / a?+                      Possessive quantifiers
      (?1) / (?&name) / (?R)               Recursive patterns
      ${^MATCH} ${^PREMATCH} ${^POSTMATCH} Match variables (with /p)
      \g{N}                                Relative/absolute backreference

    Perl 5.12
      package NAME VERSION
      ...                                  Yada-yada operator

    Perl 5.14
      s///r  tr///r                        Non-destructive flag

    Perl 5.16
      __SUB__

    Perl 5.18
      my sub foo { }                       Lexical subroutine declaration
      state sub foo { }

    Perl 5.20
      sub foo ($x, $y) { }                 Subroutine signatures
      $ref->@*  $ref->%*                   Postfix dereference
      %hash{LIST}  %array[LIST]            Key/value (index/value) slices

    Perl 5.22
      <<>>                                 Double-diamond operator
      /n                                   Non-capturing regex flag
      $a &. $b  $a |. $b  $a ^. $b  ~.$a  String bitwise operators
      foreach \$x (@list)                  Reference aliasing in foreach

    Perl 5.26
      <<~                                  Indented heredoc

    Perl 5.30
      (?<=.{2,}X)                          Variable-length lookbehind

    Perl 5.32
      $obj isa ClassName                   isa infix operator
                                           (->isa() and isa() calls excluded)

    Perl 5.34
      try { } catch ($e) { }

    Perl 5.36
      use builtin
      for my ($a, $b) (@list)              Paired iteration

    Perl 5.38
      class Foo { }                        class keyword
      Variable-length lookbehind (stable)

    Perl 5.40
      $x ^^ $y  /  $x ^^= $y              High-precedence logical XOR
      __CLASS__

    Perl 5.42
      any { EXPR } @list                   Keyword operators
      all { EXPR } @list                   (suppressed when List::Util
                                            imports any/all)
      my method foo () { }                 Lexical method declaration



( run in 0.714 second using v1.01-cache-2.11-cpan-9581c071862 )