in reply to Re: Backtics execution with multiple lines
in thread Backtics execution with multiple lines

Backticks capture output, but system doesn't. Using exec directly is too much work. open '|-' would be the appropriate choice here.

$ perl -e' > my @cmd = ( echo => "foo\nbar" ); > open(my $fh, "|-", @cmd); > print <$fh>; > ' foo bar

Bonus: The shell isn't involved if the command has an argument.