From: Martin R. <mr...@us...> - 2004-10-18 17:58:27
|
Update of /cvsroot/ltp/ltp/testcases/ballista/ballista/perllib/auto/URI/URL/http In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18149/auto/URI/URL/http Added Files: autosplit.ix query_form.al keywords.al Log Message: Inital drop of ballista testsuite --- NEW FILE: query_form.al --- # NOTE: Derived from ./blib/lib/URI/URL/http.pm. Changes made here will be lost. package URI::URL::http; # Handle ...?foo=bar&bar=foo type of query sub query_form { my $self = shift; $old = $self->{'query'}; if (@_) { # Try to set query string my @query; my($key,$vals); my $esc = $URI::URL::reserved . $URI::URL::unsafe; while (($key,$vals) = splice(@_, 0, 2)) { $key = '' unless defined $key; $key = URI::Escape::uri_escape($key, $esc); $vals = [$vals] unless ref($vals) eq 'ARRAY'; my $val; for $val (@$vals) { $val = '' unless defined $val; $val = URI::Escape::uri_escape($val, $esc); push(@query, "$key=$val"); } } $self->equery(join('&', @query)); } return if !defined($old) || length($old) == 0 || !defined(wantarray); Carp::croak("Query is not a form") unless $old =~ /=/; map { s/\+/ /g; URI::Escape::uri_unescape($_) } map { /=/ ? split(/=/, $_, 2) : ($_ => '')} split(/&/, $old); } 1; 1; --- NEW FILE: autosplit.ix --- # Index created by AutoSplit for ./blib/lib/URI/URL/http.pm (file acts as timestamp) package URI::URL::http; sub keywords ; sub query_form ; 1; --- NEW FILE: keywords.al --- # NOTE: Derived from ./blib/lib/URI/URL/http.pm. Changes made here will be lost. package URI::URL::http; # Handle ...?dog+bones type of query sub keywords { my $self = shift; $old = $self->{'query'}; if (@_) { # Try to set query string $self->equery(join('+', map { URI::Escape::uri_escape($_, $URI::URL::reserved) } @_)); } return if !defined($old) || !defined(wantarray); Carp::croak("Query is not keywords") if $old =~ /=/; map { URI::Escape::uri_unescape($_) } split(/\+/, $old); } 1; |