in reply to Re^2: pass variable to another process when invoking from command line
in thread pass variable to another process when invoking from command line

You have three different languages seemingly confused (sh, awk, and Perl).

If the second program is a shell script, while (my $var = <STDIN>) is wrong. (You probably need something like read var.) If it is in Perl, you can't invoke awk just by mentioning it; you need system or something like that.