Graph::Undirected::Hamiltonicity::Output - convenience subroutines for printing output in various formats.
The output() subroutine examines an environment variable called HC_OUTPUT_FORMAT to determine the output format. The output format can be one of:
'html' : output in HTML form, with graphs embedded as inline SVG.
'text' : output in text form, with graphs converted to edge-lists.
'none' : do no generate any output.
use Graph::Undirected::Hamiltonicity::Output; output("Foo<BR/>"); # in html mode, say "Foo<BR/>" # in text mode, say "Foo" # in none mode, print nothing. output($g); # $g is a Graph::Undirected # in html mode, print the SVG to draw this graph # in text mode, print the adjacency-list of this graph # in none mode, print nothing. output($g, { required => 1 }); # Indicates that the graph should be formatted # as a graph of "required" edges only.
Exports the output() subroutine by default.
This subroutine produces output polymorphically, based on the state of the HC_OUTPUT_FORMAT environment variable, and on the input.
It is overloaded to output literal HTML, text stripped from HTML, and SVG embedded inline.
Ashwin Dixit, <ashwin at ownlifeful dot com>
<ashwin at ownlifeful dot com>
To install Graph::Undirected::Hamiltonicity, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graph::Undirected::Hamiltonicity
CPAN shell
perl -MCPAN -e shell install Graph::Undirected::Hamiltonicity
For more information on module installation, please visit the detailed CPAN module installation guide.