in reply to Re^2: Issue with regex matching
in thread Issue with regex matching

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); }