I have following line in my perl script (which I run from cshell)
system("perl -p -i -e 's/\+[a-z]+\+//g' $file1");
I expect it to delete all the words which are surrounded by + plus signs. Instead, I’m getting below error message.
Quantifier follows nothing in regex; marked by <– HERE in m/+ <– HERE [a-z]++/ at -e line 1.
What is happening? I gave backslashes, why then this error?
Let’s say
$file1contains-foo bar.txt, the string literalproduces the string
Don’t create a shell command when you don’t need to. Just launch
perldirectly.But why create a new process at all? You can use the following to do the exact same thing!
Or as a sub: