in reply to Re^4: Use text string as stdin for system process
in thread Use text string as stdin for system process

Actually, you can do exactly the same thing in Perl, although it's considered stylistically sucky and is a hazard to security if there are variables that mischievous users can set to evil values.
$x=`cat <<endl | grep whatever yadda yadda whatever yadda yadda endl`; chomp $x; print qq{\$x="$x"\n};
prints
$x="whatever"