use CGI::Carp qw/fatalsToBrowser/; use Data::Dumper # yada yada yada die Dumper $form; # or some other data-structure #### # this is part of the actions-dispatch of my wiki-project 'debug' => sub { use MIME::Base64; use GraphViz::Data::Grapher; my $debug_wiki; while (my ($k, $v) = each %$wiki) { $debug_wiki->{$k} = substr($v, 0, 20).' ...'; } my $graph = GraphViz::Data::Grapher->new($debug_wiki); return $q->header(), $q->start_html('DEBUG'), 'debug', $q->end_html; }, #### # this is part of the actions-dispatch of my wiki-project 'analyze' => sub { use GraphViz; use MIME::Base64; my $g = GraphViz->new(); $g->add_node($_) for keys %$wiki; while (my ($k, $v) = each %$wiki) { $g->add_edge($k => $_) for ($v =~ /$wikiwords/g); } return $q->header(), $q->start_html('ANALYZE'), 'debug', $q->end_html; }