1HTTP::Headers::ActionPaUcske:r:PCroinotrriitbyuLtieHsdTtT(PP3e:)r:lHeDaodceurmse:n:tAacttiioonnPack::PriorityList(3)
2
3
4

NAME

6       HTTP::Headers::ActionPack::PriorityList - A Priority List
7

VERSION

9       version 0.09
10

SYNOPSIS

12         use HTTP::Headers::ActionPack::PriorityList;
13
14         # simple constructor
15         my $plist = HTTP::Headers::ActionPack::PriorityList->new(
16             [ 1.0 => 'foo' ],
17             [ 0.5 => 'bar' ],
18             [ 0.2 => 'baz' ],
19         );
20
21         # from headers
22         my $plist = HTTP::Headers::ActionPack::PriorityList->new_from_string(
23             'foo; q=1.0, bar; q=0.5, baz; q=0.2'
24         );
25

DESCRIPTION

27       This is a simple priority list implementation, this is used to handle
28       the Accept-* headers as they typically will contain values along with a
29       "q" value to indicate quality.
30

METHODS

32       "new"
33       "new_from_string ( $header_string )"
34           This accepts a HTTP header string which get parsed and loaded
35           accordingly.
36
37       "index"
38       "items"
39       "add ( $quality, $choice )"
40           Add in a new $choice with a given $quality.
41
42       "get ( $quality )"
43           Given a certain $quality, it returns the various choices available.
44
45       "priority_of ( $choice )"
46           Given a certain $choice this returns the associated quality of it.
47
48       "iterable"
49           This returns a list of two item ARRAY refs with the quality as the
50           first item and the associated choice as the second item. These are
51           sorted accordingly.
52
53           When two items have the same priority, they are returned in the
54           order that they were found in the header.
55
56       "canonicalize_choice"
57           By default, this does nothing. It exists so that subclasses can
58           override it.
59

AUTHOR

61       Stevan Little <stevan.little@iinteractive.com>
62

CONTRIBUTORS

64       •   Andrew Nelson <anelson@cpan.org>
65
66       •   Dave Rolsky <autarch@urth.org>
67
68       •   Florian Ragwitz <rafl@debian.org>
69
70       •   Jesse Luehrs <doy@tozt.net>
71
72       •   Karen Etheridge <ether@cpan.org>
73
75       This software is copyright (c) 2012 by Infinity Interactive, Inc..
76
77       This is free software; you can redistribute it and/or modify it under
78       the same terms as the Perl 5 programming language system itself.
79
80
81
82perl v5.38.0                      202H3T-T0P7:-:2H0eaders::ActionPack::PriorityList(3)
Impressum