Open KES777 opened 3 years ago
An unfortunate instance of whitespace sensitivity:
$ perl -wE 'say( $v /3 )'
Search pattern not terminated at -e line 1.
$ perl -wE 'say( $v / 3 )'
Name "main::v" used only once: possible typo at -e line 1.
Use of uninitialized value $v in division (/) at -e line 1.
0
$ perl -wE 'say( $v/3 )'
Name "main::v" used only once: possible typo at -e line 1.
Use of uninitialized value $v in division (/) at -e line 1.
0
@leonerd Could it be improved?
Could it be improved?
I suspect not. As often happens the culprit here is an indirect method invocation: say $v /3/
is a legitimate expression.
Could it be improved?
I suspect not. As often happens the culprit here is an indirect method invocation:
say $v /3/
is a legitimate expression.
Is there any way we could provide documentation that would alert users to this type of bug?
Description
Correct perl code is not parsed properly
Steps to Reproduce
Expected behavior I expect result of division. It must work same as:
Perl configuration
I do not use
=~
, but perl thinks that/
is not division but start of regular expression.This is hard to find what is wrong at more wide context. See next part of code:
Error occur:
https://stackoverflow.com/q/68863999/4632019