use strict; use warnings; use IPC::Run qw(run binary); my $dot = qq(digraph g { graph [] A -> B; C -> B; }); run ['dot', '-Tgif'], \$dot, '>', binary(), 'test_tree.gif';