Reputation: 618
When executing my Perl script I receive the error "Unterminated <> operator at ...". I'm not understanding why. What does this error mean?
Upvotes: 1
Views: 791
Reputation: 618
The "<>" operator is an I/O operator described in PerlDoc - I/O Operators.
When your code contains some syntax error, the perl interpreter may found a "<" character in a context apparently good for "<>" operator, so it will complain about the missing ">".
Example of previous syntax error may be a missing parenthesis, but can be somenthing more subtle.
For example it happened to me, I was using the "//" operator introduced in Perl 5.10 (see https://perldoc.perl.org/5.10.0/perldelta). When I launched my script in Perl 5.8 the syntax checker was confused by the "//" characters contained a few lines before the one returning the syntax error.
So, my suggestion when you encounter this error (but this may be valid for any syntax error), is to look backward in your code, starting from the line number written in the error message.
Upvotes: 2