Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You are using Perl, but your question pertains to the shell that evaluates the command in backticks. To solve this, you have to see, why your shell doesn't like the command.
Besides take a look at perlop. There is a section about quoting (and you should quote, what you are giving to the shell) stating about the command given in backticks: "How that string gets evaluated is entirely subject to the command interpreter on your system." For example, when I try to run your code on my Ubuntu I am getting something like
I am assuming however, that you don't really want to search a string in Perl that way (there are better ways), but to learn something about calling external commands. In reply to Re^3: sh: -c: line 1: syntax error near unexpected token `|'
by lune
|
|