|
#!/usr/bin/perl -w
BEGIN { $|++; }
my $file = shift ;
my $id = shift || '' ;
my $debug = shift ;
my $parser = Graph::Easy::Parser->new( debug => $debug );
if (! defined $file )
{
$file = \ *STDIN ;
binmode STDIN, ':utf8' or die ( "binmode STDIN, ':utf8' failed: $!" );
}
binmode STDERR, ':utf8' or die ( "binmode STDERR, ':utf8' failed: $!" );
my $graph = $parser ->from_file( $file );
die ( $parser ->error()) unless defined $graph ;
$graph ->id( $id );
$graph ->timeout(360);
$graph ->layout();
warn ( $graph ->error()) if $graph ->error();
binmode STDOUT, ':utf8' or die ( "binmode STDOUT, ':utf8' failed: $!" );
print $graph ->as_ascii();
|