I have been looking at extracting user_agent information from the wurfl web browsers patch using XML::Simple. I have succeeded in getting the info but it's very explicit - I was hoping that someone might show me how else this could be done. Thanks.
#!/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 = 'http://wurfl.sourceforge.net/web_browsers_patch.xml';
my $content = get($url);
# create object
my $xml = new XML::Simple;
# read XML file
my $data = $xml->XMLin($content);
# print output
my ($key, $value) = %{ $data };
($key, $value) = %{ $value };
my @keys = keys %{ $value };
foreach (@keys) {
print qq~$data->{devices}->{device}->{$_}->{user_agent}<br>\n~;
}