#!/usr/bin/perl use strict; use warnings; package RoleDigraph; use Moose::Role; requires '_as_queque'; sub as_digraph { my $self = shift; my @queque = @{$self->_as_queque}; my $o = 'digraph G {' . "\n"; $o .= "\t" . $_->[0] . ' -> ' . $_->[1] . ";\n" for @queque; $o .= "}\n"; return $o; } 1;