# New Ticket Created by Alex Jakimenko # Please include the string: [perl #125902] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=125902 >
Code: my Str where 'foo' $test; Result: ===SORRY!=== Type 'Str' is not declared. Did you mean 'str'? at ./test.pl:2 ------> my Str ⏏where 'foo' $test; Malformed my at ./test.pl:2 ------> my Str ⏏where 'foo' $test; Well, let's also try what it says: my str where 'foo' $test; Result: ===SORRY!=== Type 'str' is not declared. Did you mean 'Str'? at ./test.pl:2 ------> my str ⏏where 'foo' $test; Malformed my at ./test.pl:2 ------> my str ⏏where 'foo' $test; Current error message is misleading. But when it's fixed, maybe it could figure out that 'where' is misplaced? For me it was a natural thing to type “Str where 'foo'”, I think that other people could mistakenly try that too. If it is possible to detect that and suggest a fix, so much the better.