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.18

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 (Macintosh; U; Max OS X 50.7; rv:6.8.4) ... Safari/5.4.4";

  # my $result = $plugin->execute;

  # "Mozilla/9.0 (X11; U; Linux x86_64; rv:0.3) Gecko/20210406 X11 Chrome/5.8";

  # my $result = $plugin->execute;

  # "Mozilla/9.8 (Macintosh; U; Max OS X 52.3; rv:0.9.1) ... Chrome/2.50";

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.