Since you are in single-quotes, attempting to escape the $ using \$ causes the $ to be interpreted literally by perl where you did not intend.
Specifically, I think you intended perl to see "$var" , but you have a "\" preceding the $ , and that \ is passed to perl, so perl thinks you want a literal $var, instead of interpolating.
Here is how perl currently sees your re:
You need to remove all attempts to escape all $'s in front of variable names.s#\Q(.*)\$/',\$lines,\$matches))10.(.*)\$/',\$lines,\$matches))(.*)\ +$/',\$lines,\$matches))# #gi
Update:The problem is that \Q interpolates and disallows \$ - see my response below.
Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax
In reply to Re^5: Delete a line from the file
by NetWallah
in thread Delete a line from the file
by ajd335
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |