in reply to ticked off with backticks

my $output = `gnuplot $cmd 2>&1`;
That will merge the STDERR output of gnuplot into STDOUT, so it'll all end up together in $output. Then you go from there in terms of working out your issues.

BTW, you might have better luck using IPC::Run, if you need to separate STDOUT and STDERR:

use IPC::Run qw( run ); my ($stdout, $stderr); run ["gnuplot", $cmd], undef, \$stdout, \$stderr;
Something like that.
------------ :Wq Not an editor command: Wq