# New Ticket Created by Sam S. # Please include the string: [perl #131754] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=131754 >
A more helpful error message than just the generic "Two terms in a row" could be thrown when the user writes e.g. foo 42; as if `foo` were a subroutine, but it's actually some other kind of bareword such as: * a constant - `constant foo = ...` * a sigilless variable - `my \foo = ...` * a typename - `class foo { ... }` * a label - `foo: ...` * a term - `sub term:<foo> { ... }` The error message could be expanded like this: ===SORRY!=== Error while compiling [...] Two terms in a row at [...] ------> say foo⏏ 42; Note: "foo" is not a subroutine, but a constant declared at [...]. Or in the special case that there actually *is* a subroutine with the same name in any parent scope (including CORE::), but it's clobbered by the other bareword: ===SORRY!=== Error while compiling [...] Two terms in a row at [...] ------> say foo⏏ 4; Note: "foo" here does not refer to the subroutine declared at [...], but to the constant declared at [...]. If the sub is declared inside the setting, the phrase "the subroutine declared at [...]" could be replaced with "the built-in subroutine".