File: dumper.pl

package info (click to toggle)
libgraphviz-perl 2.16-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 940 kB
  • ctags: 67
  • sloc: perl: 2,059; makefile: 2
file content (25 lines) | stat: -rwxr-xr-x 651 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl -w
#
# This is a simple example which provides an 
# alternative way of displaying a data structure
# than Data::Dumper

use strict;
use lib '../lib';
use GraphViz::Data::Grapher;

my(@d);

#@d = qw(3 1 4 1);
#@d = ([3, 1, 4, 1], 9, 9, 9);
#@d = ([3, 1, 4, 1], "foo", \"bar", \3.141, [[3]]);
#@d = ({ a => '3', b => '4'});
#@d = ("red", { a => [3, 1, 4, 1], b => { q => 'a', w => 'b'}}, "blue", undef, GraphViz::Data::Grapher->new(), 2);
@d = ("red", { a => [3, 1, 4, 1], b => { q => 'a', w => 'b'}}, "blue", undef);

my $graph = GraphViz::Data::Grapher->new(\@d);

$graph->as_png("dumper.png");

#use Data::Dumper;
#warn Dumper(\@d);