Check out the latest documentation.

Pattern Reference

The 51Degrees Perl Pattern API makes the following functions available. See the Pattern Example for a working perl program.

dataSetInitWithPropertyString

This function creates a data set for detection using the given file name and fills it with properties as controlled by $propertyString.

$propertyString should be given in the following form: 'Id,BrowserName,BrowserVendor,BrowserVersion'. Properties should be separated by a comma.

This function returns a number that internally references a data set. It should be used as arguments for the following functions.

									number dataSetInitWithPropertyString(
										
										$fileName
										
									, 
										
										$propertyString
										
									)

									

getMatch

This function returns a string of device data from a useragent string in a JSON format.

$dataSetReference should be the reference returned from dataSetInitWithPropertyString.

									string getMatch(
										
										$dataSetReference
										
									, 
										
										$userAgent
										
									)

									

destroyDataset

The function destroys a dataset from a given dataset reference so resources can be freed. The dataset reference should not be used in any other functions following this one.

									void destroyDataset(
										
										$dataSetReference
										
									)