in reply to Re^3: Print multiple value from file
in thread Print multiple value from file

Oh, thanks a lot, it works now, but when I tried to print observed data such C/T, it does not work. and very thanks for your help

Replies are listed 'Best First'.
Re^5: Print multiple value from file
by poj (Abbot) on Aug 10, 2015 at 11:35 UTC

    Consider using XML::Twig for parsing XML

    #!perl use strict; use warnings; use XML::Twig; my $twig = new XML::Twig( twig_handlers =>{ 'Ss' => \&Ss } ); $twig->parsefile('ds_chY.xml'); sub Ss { my ($t,$e) = @_; my $obs = $e->first_child('Sequence')->first_child('Observed'); print $e->att('ssId')."\t".$e->att('subSnpClass')."\t"; print $obs->text."\n"; }
    UPDATE : added Observed

    poj