Mobile::WURFL::Device - WURFL Device
use Mobile::WURFL::Device; my $device = Mobile::WURFL::Device->new({ device_data => $hashref }); my $ua_string = $device->_attribute('user_agent'); if ($device->gif eq 'true') { # do something }
Instantiated by Mobile::WURFL, a Device lists the capabilities of a mobile telephone handset identified by a user agent string.
new
Accepts a hash reference, a key named device_data can be used to feed data to object constructor; data should be a reference to a structure like this:
{ attributes => { attribute => value, other => value }, capabilities => { attribute => value, other => value } }
_attribute
accepts an attribute name and returns its value in the current Device; valid attributes are:
user_agent
User Agent string.
id
unique identifier.
actual_device_root
set to true if current Device is an actual device.
fall_back
the identifier of an other Device from which the current Device inherits other capabilities.
_list_attributes
returns the sorted list of available attributes.
_list_capabilities
returns the sorted list of available capabilites.
capability
accepts an capability name and returns its value in the current Device; refer to WURFL documentation for a list of valid capabilities.
AUTOLOAD
if an AUTOLOADed method matches one of the WURFL capabilities, it returns the corresponding value stored in the current Device (see capability method).
Mobile::WURFL http://wurfl.sourceforge.net
Valerio VALDEZ Paolini <valdez@cpan.org>
Copyright (C) 2005 by Valerio VALDEZ Paolini <valdez@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.
To install Mobile::WURFL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mobile::WURFL
CPAN shell
perl -MCPAN -e shell install Mobile::WURFL
For more information on module installation, please visit the detailed CPAN module installation guide.