in reply to Simple awk question
What you seem to want is open with a pipe-symbol¹ to write to awk's STDIN.
Calling awk from Perl is somehow strange, though, Perl was primarily designed to replace awk and sed .
if you just wanna pass a handful of variables better use arguments in backticks
my $result = `awk $var1 $var2`;
but I don't know much about awk (cause I don't need to ;-)
Cheers Rolf
(addicted to the Perl Programming Language)
¹) like in
open(my $awk, "|awk >Tmp$$") # $$ is our process id or die "Can't start awk: $!"; print $awk $var1, $var2; close $awk;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Simple awk question
by RonW (Parson) on Jun 05, 2014 at 17:38 UTC |