in reply to $var | system()

If the text does not contain single quotes, you can just quote it:
my $x = "..multiline\ntext.."; print qx{ echo '$x' | sed 's/^/> /'};
For more complicated strings, you can use
my $x = qq(..multiline\ntext.."'); open my $CMD, '|-', q{sed 's/^/> /'} or die $!; print {$CMD} $x; close $CMD;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ