Permalink
Browse files

Give a lot more example code in the SYNOPSIS

  • Loading branch information...
1 parent 03d6bcb commit e22dc6f15ecccdb3906d9f1b9ce203a30a4c78d0 @leto committed Nov 11, 2010
Showing with 19 additions and 1 deletion.
  1. +19 −1 lib/WWW/PhyloBox.pm
View
@@ -42,12 +42,30 @@ WWW::PhyloBox - Perl interface to phylobox.appspot.com
=head1 SYNOPSIS
use WWW::PhyloBox;
+ use File::Slurp qw/slurp/;
+
my $phylobox = WWW::PhyloBox->new;
- $phylobox->create(
+
+ # this creates a phylogenetic tree from a remote file
+ my $tree1 = $phylobox->create(
phyloUrl => "http://example.com/phylo.xml",
+ response => "key",
+ name => "Moose speciation",
+ );
+ print $tree1->name . " tree is at " . $tree1->url . "\n";
+
+ # read in PhyloXML to a string
+ my $phyloxml = slurp("phylo.xml");
+
+ # this creates a phylogenetic tree from string data
+ my $tree2 = $phylobox->create(
+ phyloFile => $phyloxml,
response => "key",
+ name => "T. Rex speciation",
);
+ print $tree2->name " has a key of " . $tree2->key . "\n";
+
=head1 ABSTRACT
PhyloBox is an online environment for viewing, editing, sharing, and publishing

0 comments on commit e22dc6f

Please sign in to comment.