Thanks for those clarifications. Athanasius has supplied a clear explanation the issue of the brackets and you've provided the extra information that $constant need only be counted at the start of the line. With that in mind we can use the simple (but potentially very inefficient) method with index thus:
$constant = '$$'; $line_count =0; while (<FILE>){ $line_count++ unless index ($_, $constant); }
In reply to Re^3: Issue with regex matching
by hippo
in thread Issue with regex matching
by sowais
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |