Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Give a lot more example code in the SYNOPSIS

  • Loading branch information...
commit e22dc6f15ecccdb3906d9f1b9ce203a30a4c78d0 1 parent 03d6bcb
Duke Leto authored November 10, 2010

Showing 1 changed file with 19 additions and 1 deletion. Show diff stats Hide diff stats

  1. 20  lib/WWW/PhyloBox.pm
20  lib/WWW/PhyloBox.pm
@@ -42,12 +42,30 @@ WWW::PhyloBox - Perl interface to phylobox.appspot.com
42 42
 =head1 SYNOPSIS
43 43
 
44 44
     use WWW::PhyloBox;
  45
+    use File::Slurp qw/slurp/;
  46
+
45 47
     my $phylobox = WWW::PhyloBox->new;
46  
-    $phylobox->create(
  48
+
  49
+    # this creates a phylogenetic tree from a remote file
  50
+    my $tree1 = $phylobox->create(
47 51
         phyloUrl => "http://example.com/phylo.xml",
  52
+        response => "key",
  53
+        name     => "Moose speciation",
  54
+    );
  55
+    print $tree1->name . " tree is at " . $tree1->url . "\n";
  56
+
  57
+    # read in PhyloXML to a string
  58
+    my $phyloxml = slurp("phylo.xml");
  59
+
  60
+    # this creates a phylogenetic tree from string data
  61
+    my $tree2 = $phylobox->create(
  62
+        phyloFile => $phyloxml,
48 63
         response  => "key",
  64
+        name      => "T. Rex speciation",
49 65
     );
50 66
 
  67
+    print $tree2->name " has a key of " . $tree2->key . "\n";
  68
+
51 69
 =head1 ABSTRACT
52 70
 
53 71
 PhyloBox is an online environment for viewing, editing, sharing, and publishing

0 notes on commit e22dc6f

Please sign in to comment.
Something went wrong with that request. Please try again.