The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Faker::Plugin::HttpUserAgent - HTTP User-Agent

ABSTRACT

HTTP User-Agent for Faker

VERSION

1.19

SYNOPSIS

  package main;

  use Faker::Plugin::HttpUserAgent;

  my $plugin = Faker::Plugin::HttpUserAgent->new;

  # bless(..., "Faker::Plugin::HttpUserAgent")

DESCRIPTION

This package provides methods for generating fake data for HTTP user-agents.

INHERITS

This package inherits behaviors from:

Faker::Plugin

METHODS

This package provides the following methods:

execute

  execute(HashRef $data) (Str)

The execute method returns a returns a random fake HTTP user-agent.

Since 1.17

execute example 1
  package main;

  use Faker::Plugin::HttpUserAgent;

  my $plugin = Faker::Plugin::HttpUserAgent->new;

  # bless(..., "Faker::Plugin::HttpUserAgent")

  # my $result = $plugin->execute;

  # "Mozilla/6.1 (Windows; U; Windows NT 07.6; rv:0.4.5) ... Windows Firefox/4.4.3";

  # my $result = $plugin->execute;

  # "Mozilla/5.8 (Macintosh; U; Mac OS 58.2; rv:0.02) ... Macintosh Safari/0.5";

  # my $result = $plugin->execute;

  # "Mozilla/9.9 (Macintosh; U; Mac OS 58.9; rv:1.25) ... Macintosh Safari/0.6";

new

  new(HashRef $data) (Plugin)

The new method returns a new instance of the class.

Since 1.17

new example 1
  package main;

  use Faker::Plugin::HttpUserAgent;

  my $plugin = Faker::Plugin::HttpUserAgent->new;

  # bless(..., "Faker::Plugin::HttpUserAgent")

AUTHORS

Awncorp, awncorp@cpan.org

LICENSE

Copyright (C) 2000, Al Newkirk.

This program is free software, you can redistribute it and/or modify it under the terms of the Apache license version 2.0.