http://www.perlmonks.org?node_id=1040644


in reply to Re^3: extract tag content from VLC webserver via XML::Rules
in thread extract tag content from VLC webserver via XML::Rules

Just change the line

$nowplaying = $_[1]->{_content}

to

$nowplaying .= $_[1]->{_content}

You just missed the contatenation sign. :-)

Update: Another way could be to populate a data structure with this content, e.g. push @array,$_[1]->{_content} if ... where @array is declared outside the parser.

Update 2:After some thoughts: in fact your version works for me in the presented example too. However I reckon that you have more than one xml in your real script so that the content is lost if you have <info name="now_playing"/>somewhere later (though you should get a warning "Use of uninitialized value" - both in original and contatenation versions (in your OP you have not "use warnings" on).