That would work if you ran the program like so:
perl -i -pe 's/^\s*\'.*//' targetfilename
On the perlrun page you can see why this works (along with examples of how -p and -i expand).
You are running your substitution on the filename rather than on any of the contents of it.
-Paul
In reply to Re: removing comments
by jettero
in thread removing comments
by dhudnall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |