use GraphViz; my $g = GraphViz->new(); foreach $command (@commands) { eval('$g->'.$command); }