Then you want to selectively quote the variables using backslashes or construct your strings more carefully by joining them together from other parts:
print "My two cents: \0.02\n"; my $cat = 'cat'; print "Some awk command: $cat | awk '{ print \$2 }'\n";
But maybe you just want to use Perl instead of sed and awk? There are even converters that give you the rough Perl code you need for an awk program. See a2p.
In reply to Re^3: system call (backticks) with pipes
by Corion
in thread system call (backticks) with pipes
by papai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |