From: Steve Peters Date: Mon, 13 Apr 2009 13:56:36 +0000 (-0500) Subject: Upgrade to CGI.pm-3.43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad6402bdb921e482fec0b070a69ca353669e4a93;p=p5sagit%2Fp5-mst-13.2.git Upgrade to CGI.pm-3.43 --- diff --git a/lib/CGI.pm b/lib/CGI.pm index 21d74c0..61118bd 100644 --- a/lib/CGI.pm +++ b/lib/CGI.pm @@ -18,8 +18,8 @@ use Carp 'croak'; # The most recent version and complete docs are available at: # http://stein.cshl.org/WWW/software/CGI/ -$CGI::revision = '$Id: CGI.pm,v 1.260 2008/09/08 14:13:23 lstein Exp $'; -$CGI::VERSION='3.42'; +$CGI::revision = '$Id: CGI.pm,v 1.263 2009/02/11 16:56:37 lstein Exp $'; +$CGI::VERSION='3.43'; # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. @@ -294,10 +294,10 @@ sub import { # To allow overriding, search through the packages # Till we find one in which the correct subroutine is defined. my @packages = ($self,@{"$self\:\:ISA"}); - foreach $sym (keys %EXPORT) { + for $sym (keys %EXPORT) { my $pck; my $def = ${"$self\:\:AutoloadClass"} || $DefaultClass; - foreach $pck (@packages) { + for $pck (@packages) { if (defined(&{"$pck\:\:$sym"})) { $def = $pck; last; @@ -317,7 +317,7 @@ sub expand_tags { return ("start_$1","end_$1") if $tag=~/^(?:\*|start_|end_)(.+)/; my(@r); return ($tag) unless $EXPORT_TAGS{$tag}; - foreach (@{$EXPORT_TAGS{$tag}}) { + for (@{$EXPORT_TAGS{$tag}}) { push(@r,&expand_tags($_)); } return @r; @@ -381,7 +381,7 @@ sub new { sub DESTROY { my $self = shift; if ($OS eq 'WINDOWS') { - foreach my $href (values %{$self->{'.tmpfiles'}}) { + for my $href (values %{$self->{'.tmpfiles'}}) { $href->{hndl}->DESTROY if defined $href->{hndl}; $href->{name}->DESTROY if defined $href->{name}; } @@ -433,7 +433,7 @@ sub param { if (substr($p[0],0,1) eq '-') { @values = defined($value) ? (ref($value) && ref($value) eq 'ARRAY' ? @{$value} : $value) : (); } else { - foreach ($value,@other) { + for ($value,@other) { push(@values,$_) if defined($_); } } @@ -488,7 +488,7 @@ sub self_or_CGI { # Initialize the query object from the environment. # If a parameter list is found, this object will be set -# to an associative array in which parameter names are keys +# to a hash in which parameter names are keys # and the values are stored as lists # If a keyword list is found, this method creates a bogus # parameter list with the single parameter 'keywords'. @@ -603,7 +603,7 @@ sub init { last METHOD; } if (ref($initializer) && ref($initializer) eq 'HASH') { - foreach (keys %$initializer) { + for (keys %$initializer) { $self->param('-name'=>$_,'-value'=>$initializer->{$_}); } last METHOD; @@ -697,9 +697,9 @@ sub init { $self->delete_all(); } - # Associative array containing our defined fieldnames + # hash containing our defined fieldnames $self->{'.fieldnames'} = {}; - foreach ($self->param('.cgifields')) { + for ($self->param('.cgifields')) { $self->{'.fieldnames'}->{$_}++; } @@ -752,7 +752,7 @@ sub save_request { # again, we initialize ourselves in exactly the same way. This allows # us to have several of these objects. @QUERY_PARAM = $self->param; # save list of parameters - foreach (@QUERY_PARAM) { + for (@QUERY_PARAM) { next unless defined $_; $QUERY_PARAM{$_}=$self->{param}{$_}; } @@ -765,7 +765,7 @@ sub parse_params { my($self,$tosplit) = @_; my(@pairs) = split(/[&;]/,$tosplit); my($param,$value); - foreach (@pairs) { + for (@pairs) { ($param,$value) = split('=',$_,2); next unless defined $param; next if $NO_UNDEF_PARAMS and not defined $value; @@ -899,7 +899,7 @@ sub _setup_symbols { # to avoid reexporting unwanted variables undef %EXPORT; - foreach (@_) { + for (@_) { $HEADERS_ONCE++, next if /^[:-]unique_headers$/; $NPH++, next if /^[:-]nph$/; $NOSTICKY++, next if /^[:-]nosticky$/; @@ -928,7 +928,7 @@ sub _setup_symbols { next; } - foreach (&expand_tags($_)) { + for (&expand_tags($_)) { tr/a-zA-Z0-9_//cd; # don't allow weird function names $EXPORT{$_}++; } @@ -1006,7 +1006,7 @@ sub delete { my(@names) = rearrange([NAME],@p); my @to_delete = ref($names[0]) eq 'ARRAY' ? @$names[0] : @names; my %to_delete; - foreach my $name (@to_delete) + for my $name (@to_delete) { CORE::delete $self->{param}{$name}; CORE::delete $self->{'.fieldnames'}->{$name}; @@ -1028,7 +1028,7 @@ sub import_names { die "Can't import names into \"main\"\n" if \%{"${namespace}::"} == \%::; if ($delete || $MOD_PERL || exists $ENV{'FCGI_ROLE'}) { # can anyone find an easier way to do this? - foreach (keys %{"${namespace}::"}) { + for (keys %{"${namespace}::"}) { local *symbol = "${namespace}::${_}"; undef $symbol; undef @symbol; @@ -1036,7 +1036,7 @@ sub import_names { } } my($param,@value,$var); - foreach $param ($self->param) { + for $param ($self->param) { # protect against silly names ($var = $param)=~tr/a-zA-Z0-9_/_/c; $var =~ s/^(?=\d)/_/; @@ -1270,7 +1270,7 @@ sub url_param { if ($ENV{QUERY_STRING} =~ /=/) { my(@pairs) = split(/[&;]/,$ENV{QUERY_STRING}); my($param,$value); - foreach (@pairs) { + for (@pairs) { ($param,$value) = split('=',$_,2); $param = unescape($param); $value = unescape($value); @@ -1298,11 +1298,11 @@ sub Dump { my($param,$value,@result); return '' unless $self->param; push(@result,"