# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #131640]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131640 >


Let's say you have this code:

my $x;

say “$x<”;

my %h = <a 1 b 2>;
for %h.kv -> $k, $v {
    say “$k $v”
}



The error message you will get:

===SORRY!=== Error while compiling -e
Variable '$k' is not declared
at -e:6
------> for %h.kv -> ⏏$k, $v {


In a way, this is understandable. I don't know if it is possible to print 
something better in this case.

However, let's say you realize what is happening. The issue, obviously, is 
somewhere above the line where you are getting in the error message. In theory, 
if you delete everything on that line and onwards, the error message would 
complain about unclosed something, and this will lead the developer to the line 
which causes the problem.

So let's try it.

Code:

my $x;

say “$x<”;

my %h = <a 1 b 2>;


Result:
Unable to parse quote-words subscript; couldn't find right angle quote
at -e:6
------> <BOL>⏏<EOL>
    expecting any of:
        postfix


It says “couldn't find right angle quote” but does not say where the left angle 
quote was.

It should say “couldn't find right angle quote (corresponding left angle quote 
was at line X)”. We already have this kind of thing for other unclosed things 
(e.g. #`{{{ )

Reply via email to