Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: WURFL web browsers patch and XML::Simple

by jonnyfolk (Vicar)
on Dec 14, 2009 at 10:44 UTC ( #812681=note: print w/replies, xml ) Need Help??

in reply to Re: WURFL web browsers patch and XML::Simple
in thread WURFL web browsers patch and XML::Simple

That's what I was looking for - much more direct!! Thanks very much.

Update: Unfortunately including it in the code prints a blank! It makes sense to me looking at it - what has gone wrong???

Update2:The inclusion of values in jethro's update effectively fixes the problem.

#!/usr/bin/perl -w use strict; print "Content-type: text/html\n\n"; # use module use XML::Simple; use Data::Dumper; use LWP::Simple; my $url = ''; my $content = get($url); # create object my $xml = new XML::Simple; # read XML file my $data = $xml->XMLin($content); my @agents; foreach my $browser ( %{$data->{devices}->{device}} ) { push @agents, $browser->{user_agent}; } print @agents;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://812681]
[Corion]: ... the temporary tables, and also don't have a good idea on how to create unique table names for them
[hippo]: OIC. In that case leave it out but invite feature requests and see if any of the users suggest it. :-)
[Corion]: Talking about this makes me realize that it's likely only a half useful idea. But it still would be convenient to have as an option...
[Corion]: hippo: Hmmm - yeah, I could document it and wait for code implementing that option to show up ;-D

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2017-02-23 15:39 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (347 votes). Check out past polls.