Getting started example of using 51Degrees trie device detection. The example
shows how to:
- Set the various settings for 51Degrees detector
my $filename = "51Degrees-LiteV3.4.trie";
my $propertyList = "IsMobile"
- Instantiate the 51Degrees device detection provider with these
my $provider = new FiftyOneDegrees::TrieV3::Provider(
- Produce a match for a single HTTP User-Agent header
my $match = $provider->getMatch($userAgent)
- Extract the value of the IsMobile property
This example assumes you are running from the original subdirectory
i.e. Device-Detection/perl/examples/ and the 51Degrees Perl module
By comparing this to the GettingStarted.pl example which uses the
Pattern method, you can see the differences are the module name, the
data file, and it does not use a cache or pool, so these do not need
to be set.