pawelb has asked for the wisdom of the Perl Monks concerning the following question:
I can say that LibXML has a lot potential, but somehow I do not get how I can write my variable data into external file, for example: output.txt using this very module. Please, at least point where should I look for an answer. Thank You in advance!#!/usr/bin/perl use strict; use warnings; use XML::LibXML; my $source = shift @ARGV; my $prsr = XML::LibXML->new(); $prsr->keep_blanks(0); my $doc = $prsr->parse_file($source); my $top = $doc->getDocumentElement; my @licenses = $top->getElementsByTagName('feature'); foreach my $attrib (@licenses) { my $name = $attrib->getAttribute('name'); my $count = $attrib->getAttribute('count'); print $name,":",$count,"\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::LibXML save variable data to a file
by toolic (Bishop) on Jan 19, 2015 at 15:26 UTC | |
|
Re: XML::LibXML save variable data to a file
by Anonymous Monk on Jan 19, 2015 at 15:25 UTC |