File: UrlEncoded.pm

package info (click to toggle)
libhttp-entity-parser-perl 0.25-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 476 kB
  • sloc: perl: 394; makefile: 2
file content (58 lines) | stat: -rw-r--r-- 1,005 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package HTTP::Entity::Parser::UrlEncoded;

use strict;
use warnings;
use WWW::Form::UrlEncoded qw/parse_urlencoded_arrayref/;

sub new {
    bless [''], $_[0];
}

sub add {
    my $self = shift;
    if (defined $_[0]) {
        $self->[0] .= $_[0];
    }
}

sub finalize {
    return (parse_urlencoded_arrayref($_[0]->[0]), []);
}


1;
__END__

=encoding utf-8

=head1 NAME

HTTP::Entity::Parser::UrlEncoded - parser for application/x-www-form-urlencoded

=head1 SYNOPSIS

    use HTTP::Entity::Parser;
    
    my $parser = HTTP::Entity::Parser->new;
    $parser->register('application/x-www-form-urlencoded','HTTP::Entity::Parser::UrlEncoded');

=head1 DESCRIPTION

This is a parser class for application/x-www-form-urlencoded.

=head1 LICENSE

Copyright (C) Masahiro Nagano.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=head1 AUTHOR

Masahiro Nagano E<lt>kazeburo@gmail.comE<gt>

Tokuhiro Matsuno E<lt>tokuhirom@gmail.comE<gt>

=cut