CGI-Easy
view release on metacpan or search on metacpan
lib/CGI/Easy/Util.pm view on Meta::CPAN
=head2 date_http
$date = date_http( $seconds );
Convert given time into text format suitable for sending in HTTP headers.
Return date string.
=head2 date_cookie
$date = date_cookie( $seconds );
Convert given time into text format suitable for sending in HTTP header
Set-Cookie's "expires" option.
Return date string.
=head2 make_cookie
$header = make_cookie( \%cookie );
Convert HASHREF with cookie properties to "Set-Cookie: ..." HTTP header.
Possible keys in %cookie:
name REQUIRED STRING
value OPTIONAL STRING (default "")
domain OPTIONAL STRING (default "")
path OPTIONAL STRING (default "/")
expires OPTIONAL STRING or SECONDS
secure OPTIONAL BOOL
Format for "expires" should be either correct date
'Thu, 01-Jan-1970 00:00:00 GMT' or time in seconds.
Return HTTP header string.
=head2 uri_unescape_plus
$unescaped = uri_unescape_plus( $uri_escaped_value );
Same as uri_unescape from L<URI::Escape> but additionally replace '+' with space.
Return unescaped string.
=head2 burst_urlencoded
my %param = %{ burst_urlencoded( $url_encoded_name_value_pairs ) };
Unpack name/value pairs from url-encoded string (like $ENV{QUERY_STRING}
or STDIN content for non-multipart forms sent using POST method).
Return HASHREF with params, each param's value will be ARRAYREF
(because there can be more than one value for any parameter in source string).
=head2 burst_multipart
($params, $filenames, $mimetypes) = burst_multipart( $buffer, $boundary );
Unpack buffer with name/value pairs in multipart/form-data format.
This format usually used to upload files from forms, and each name/value
pair may additionally contain 'file name' and 'mime type' properties.
Return three HASHREF (with param's values, with param's file names, and
with param's mime types), all values in all three HASHREF are ARRAYREF
(because there can be more than one value for any parameter in source string).
For non-file-upload parameters corresponding values in last two hashes
(with file names and mime types) will be undef().
=head1 SUPPORT
=head2 Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker
at L<https://github.com/powerman/perl-CGI-Easy/issues>.
You will be notified automatically of any progress on your issue.
=head2 Source Code
This is open source software. The code repository is available for
public review and contribution under the terms of the license.
Feel free to fork the repository and submit pull requests.
L<https://github.com/powerman/perl-CGI-Easy>
git clone https://github.com/powerman/perl-CGI-Easy.git
=head2 Resources
=over
=item * MetaCPAN Search
L<https://metacpan.org/search?q=CGI-Easy>
=item * CPAN Ratings
L<http://cpanratings.perl.org/dist/CGI-Easy>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/CGI-Easy>
=item * CPAN Testers Matrix
L<http://matrix.cpantesters.org/?dist=CGI-Easy>
=item * CPANTS: A CPAN Testing Service (Kwalitee)
L<http://cpants.cpanauthors.org/dist/CGI-Easy>
=back
=head1 AUTHOR
Alex Efros E<lt>powerman@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2009- by Alex Efros E<lt>powerman@cpan.orgE<gt>.
This module also include some code derived from
=over
( run in 1.745 second using v1.01-cache-2.11-cpan-b16cb0d3907 )