in reply to Print attributes from two tags together
What I want is to print each MergeHistory rsId and buildId together as the following:
What has to happen for you to be able to do that?
You have to keep a stack of rsids and buildids
so
my @rsids; my @buildids; my $twig = ... 'Rs/MergeHistory' => sub { my $rsid = ...; my $buid = ...; push @rsids, $rsid; push @buildids, $buid; }, ... print $out join(',',@rsids), "\t",join(',',@buildids), "\n";
or
my @merges; my $twig = ... 'Rs/MergeHistory' => sub { my $rsid = ...; my $buid = ...; push @merges, [ $rsid, $buid ]; }, ... print $out join(',', map { $_->[0] } @merges ), "\t",join(',',map { $_->[1] } @merges ), "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Print attributes from two tags together
by AhmedABdo (Acolyte) on Sep 25, 2015 at 21:33 UTC | |
by soonix (Chancellor) on Sep 26, 2015 at 10:47 UTC |