blib/lib/Lemonldap/NG/Common/FormEncode.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 CC 2 SCAR 11.5
CC
2
Cov
0%
BEGIN
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.1
1 package Lemonldap::NG::Common::FormEncode;
2  
3 use strict;
4 use Exporter;
5  
6 our @ISA = qw(Exporter);
7 our $VERSION = '2.0.0';
8  
9 our @EXPORT_OK = qw(build_urlencoded);
10 our @EXPORT = qw(build_urlencoded);
11  
12 BEGIN {
13 require Plack::Request;
14 if ( $Plack::Request::VERSION < '1.0040' ) {
15 require URI::Escape;
16 eval <<'EOT';
17 sub build_urlencoded {
18 my(%h)=@_;
19 return join('&',map {my $v=URI::Escape::uri_escape($h{$_});"$_=$v"} keys %h);
20 }
21 EOT
22 }
23 else {
24 require WWW::Form::UrlEncoded;
25 *build_urlencoded = \&WWW::Form::UrlEncoded::build_urlencoded;
26 }
27 }
28  
29 1;