What do line numbers in perl -cw mean?

When I run "perl -cw" to check the syntax for my perl modules, and warnings or errors occur, two line numbers are given:

perl -cw lib/My/Module.pm
Global symbol "%badvar" requires explicit package name at lib/My/Module.pm line 93, <DATA> line 132.
lib/My/Module.pm had compilation errors.

"line 93" is the correct position in the source file, but what does "<DATA> line 132" mean?

+3
source share
2 answers

Error message structure:

in the line of the file x, <handle> line y.

  • - description of the error.
  • A file is the file in which the error occurred.
  • x is the line number in the file where the error occurred.
  • descriptor is the last file descriptor read from.
  • y is the last line 1 read from the descriptor.

93 lib/My/Module.pm 132- DATA. DATA - __DATA__ . , DATA . "<DATA> 132" 132- __DATA__, 132- .

1] $.. , - , $/. DATA.

+3

<DATA> DATA, __DATA__.

, , , , <>. (EDIT: , <ARGV>! .)

+2

Source: https://habr.com/ru/post/1751580/


All Articles