Permalink
Browse files

STDIN instead of parsefile().

  • Loading branch information...
1 parent a9c6ecf commit a84206573e4eb4755688bbb4c3598d3718863712 @jhannah committed Aug 6, 2009
Showing with 10 additions and 1 deletion.
  1. +10 −1 Meteorswarm/xmltwig.pl
View
@@ -2,10 +2,19 @@
# Little XML::Twig demo for Meteorswarm
# by Jay Hannah - http://bioperl.org/wiki/User:Jhannah
+#
+# Pipe XML files into this program like so:
+# cat medicago_chr0_20080103.xml | perl xmltwig.pl
+use strict;
use XML::Twig;
+
+# Grab all STDIN into $xml
+local $/ = undef;
+my $xml = <>;
+
my $twig = XML::Twig->new();
-$twig->parsefile('medicago_chr0_20080103.xml');
+$twig->parse($xml);
my $root = $twig->root;
my @x = $root->get_xpath('ASSEMBLY/GENE_LIST/PROTEIN_CODING/TU');

0 comments on commit a842065

Please sign in to comment.