You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Perl syntax highlighting breaks on regular expressions that implicitly use the default input variable and contain the '#' character.
The syntax highlighting breaks if the following conditions are met:
The regex implicitly uses the default $_ variable
The regex is not the first item in the conditional
The regex follows an 'and' or 'or' operator
The rest of the line following the # is highlighted as a comment.
if (/^#/ and $something) { moo(); } # Syntax highlighting is good if ($something && /^#/) { moo(); } # Syntax highlighting is good if ($something and /^#/) { moo(); } # Syntax highlighting breaks!
The text was updated successfully, but these errors were encountered:
Using m// instead of // (i.e. m/^#/) seems to workaround this issue.
The way I would describe why it doesn't affect the first two cases is that there isn't something to the left of the matching operator // that isn't one of a few characters of operators (&, |, and ~ are the only I've found) or the opening parenthesis (.
The Perl syntax highlighting breaks on regular expressions that implicitly use the default input variable and contain the '#' character.
The syntax highlighting breaks if the following conditions are met:
The rest of the line following the # is highlighted as a comment.
if (/^#/ and $something) { moo(); } # Syntax highlighting is good
if ($something && /^#/) { moo(); } # Syntax highlighting is good
if ($something and /^#/) { moo(); } # Syntax highlighting breaks!
The text was updated successfully, but these errors were encountered: