Home / Perl

Simple WURFL Parser
by Rainer Hillebrand

Mobile::WURFL
by Ave Wrigley


SourceForge.net Logo
 

WURFL and Perl: Simple Perl WURFL Parser WURFLLite

Rainer Hillebrand has kindly provided these utilities for Perl.

This page is derived from http://webcab.de/WURFL/

Even if WURFL is an XML application, it is not necessary to use an XML parser, like XML::Parser, for your Perl scripts to make the WURFL's information available in your scripts.

WURFLLite is a Perl module that uses regular expressions to analyze the structure of the WURFL XML file and stores the content and attributes in an anonymous hash.

In order to ease your first steps with WURFLLite, WebCab.de provides three example implementations:

  • device.pl (latest version: 0.01)
    This Perl script prints out all capabilities for a browser with a given device_id. The capabilities are recursively derived from all fall back browsers starting with the device_id "generic".
  • dump.pl (latest version: 0.03)
    This Perl script prints out the whole content of the WURFL XML file.
  • ua.pl (latest version: 0.02)
    ua.pl prints out all capabilities for a browser with a given user-agent HTTP header field. The capabilities are recursively derived from all fall back browsers starting with the device_id "generic".


Copyright © 2007-2009, Luca Passani