Skip to content

[doc] perl -c vs. "outside" #22143

Open
Open
@jidanni

Description

@jidanni

man perlrun says

  -c   causes Perl to check the  syntax  of  the  program  and  then  exit
       without  executing  it.   Actually,  it  will  execute any "BEGIN",
       "UNITCHECK", or "CHECK" blocks and any "use" statements: these  are
       considered  as  occurring  outside  the  execution of your program.
       "INIT" and "END" blocks, however, will be skipped.

It seems the word "outside" needs to be changed to "inside", for the
above paragraph to make sense.

Anyway, some people would just like to check the syntax of the single file in
front of them, without needing to comment out any "use", or providing
paths.

Just like if their program said open(my $fh, "<", "input.txt"), when not having such a input.txt ready yet. It shouldn't affect the syntax check.

So maybe an option could be added for that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions