Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: extract tag content from VLC webserver via XML::Rules

by hdb (Prior)
on Jun 25, 2013 at 09:42 UTC ( #1040571=note: print w/ replies, xml ) Need Help??


in reply to extract tag content from VLC webserver via XML::Rules

If really all you want is that one item and it is on one line of your XML file, use a regex:

/^\s*<info name="now_playing">(.*?)<\/info>$/


Comment on Re: extract tag content from VLC webserver via XML::Rules
Download Code
Replies are listed 'Best First'.
Re^2: extract tag content from VLC webserver via XML::Rules ( m{\Q\E}sx )
by Anonymous Monk on Jun 25, 2013 at 09:47 UTC

    If really all you want is that one item and it is on one line of your XML file, use a regex: /^\s*<info name="now_playing">(.*?)<\/info>$/

    If you're going to use a regex don't bother with anchors or or backslashes :)

    my( $fo ) = m{ \Q<info name="now_playing">\E (.*?) \Q</info>\E }sx;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040571]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2015-07-29 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (268 votes), past polls