in reply to Re^2: extract tag content from VLC webserver via XML::Rules
in thread extract tag content from VLC webserver via XML::Rules
Okay, I'm stuck again. I can print the now_playing content just fine, but that's not really my intention. I would like to use the data further down the line, but can't seem to get it out of the XML-Rules parser section.
I tried to populate a string called $nowplaying with it but outside of the parser section, the string prints just empty. Obviously, the print is again just temporary so I can see that it works before I continue.
How do I get the string contents outside of the parser section? Here's what I have:
my $nowplaying = ""; my $parser = XML::Rules->new( stripspaces => 7, rules => { info => sub { $nowplaying = $_[1]->{_content} if $_[1]->{name} eq 'now_playing'; return ; } } ); $parser->parse($streaminfo); print $nowplaying;
I'm sure it's again something real simple I'm missing here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: extract tag content from VLC webserver via XML::Rules
by vagabonding electron (Curate) on Jun 25, 2013 at 18:19 UTC | |
by mcoblentz (Scribe) on Jun 26, 2013 at 15:38 UTC | |
by rainforest1155 (Initiate) on Jun 27, 2013 at 11:13 UTC |