Hello community, here is the log from the commit of package perl-CGI-Simple for openSUSE:Factory checked in at 2015-04-15 16:22:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-CGI-Simple (Old) and /work/SRC/openSUSE:Factory/.perl-CGI-Simple.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-CGI-Simple" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-CGI-Simple/perl-CGI-Simple.changes 2011-11-21 12:37:10.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-CGI-Simple.new/perl-CGI-Simple.changes 2015-04-15 16:22:31.000000000 +0200 @@ -1,0 +2,17 @@ +Mon Apr 13 19:16:34 UTC 2015 - [email protected] + +- updated to 1.115 + see /usr/share/doc/packages/perl-CGI-Simple/Changes + + + 1.114 + - Drop support for Perls older than 5.6.1. + + 1.115 2014.10.19 + - Replace indirect calling of constructor both in code an documentation + with direct calling. + Write CGI::Simle->new instead of new CGI::Simple + - add tests to make sure the order of value is kept as they were passed in the QUERY_STRING + - new co-maintainer (SZABGAB( + +------------------------------------------------------------------- Old: ---- CGI-Simple-1.113.tar.gz New: ---- CGI-Simple-1.115.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-CGI-Simple.spec ++++++ --- /var/tmp/diff_new_pack.iMxgGO/_old 2015-04-15 16:22:31.000000000 +0200 +++ /var/tmp/diff_new_pack.iMxgGO/_new 2015-04-15 16:22:31.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-CGI-Simple # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,32 +16,21 @@ # -%bcond_with pod - Name: perl-CGI-Simple +Version: 1.115 +Release: 0 %define cpan_name CGI-Simple Summary: A Simple totally OO CGI interface that is CGI.pm compliant -Version: 1.113 -Release: 6 -License: GPL-1.0+ or Artistic-1.0 +License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/CGI-Simple/ -#Source: http://www.cpan.org/authors/id/A/AN/ANDYA/CGI-Simple-%{version}.tar.gz -Source: %{cpan_name}-%{version}.tar.gz +Source: http://www.cpan.org/authors/id/S/SZ/SZABGAB/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(Module::Build) -BuildRequires: perl(Test::More) BuildRequires: perl(IO::Scalar) -# optional perl(HTTP::Request::Common) -BuildRequires: apache2-mod_perl -%if 0%{?with pod} -BuildRequires: perl(Test::Pod) >= 1.14 -BuildRequires: perl(Test::Pod::Coverage) >= 1.04 -%endif -# +BuildRequires: perl(Module::Build) Requires: perl(IO::Scalar) %{perl_requires} @@ -62,6 +51,7 @@ %prep %setup -q -n %{cpan_name}-%{version} +find . -type f -print0 | xargs -0 chmod 644 %build %{__perl} Build.PL installdirs=vendor @@ -74,11 +64,8 @@ ./Build install destdir=%{buildroot} create_packlist=0 %perl_gen_filelist -%clean -%{__rm} -rf %{buildroot} - %files -f %{name}.files -%defattr(644,root,root,755) -%doc Changes README SIGNATURE +%defattr(-,root,root,755) +%doc Changes README %changelog ++++++ CGI-Simple-1.113.tar.gz -> CGI-Simple-1.115.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/.travis.yml new/CGI-Simple-1.115/.travis.yml --- old/CGI-Simple-1.113/.travis.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/CGI-Simple-1.115/.travis.yml 2014-10-19 14:42:47.000000000 +0200 @@ -0,0 +1,11 @@ +branches: + except: + - gh-pages +language: perl +perl: + - "5.20" + - "5.18" + - "5.16" + - "5.14" + - "5.12" + - "5.10" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/Changes new/CGI-Simple-1.115/Changes --- old/CGI-Simple-1.113/Changes 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/Changes 2014-10-19 14:38:08.000000000 +0200 @@ -234,3 +234,15 @@ 'application/vnd' instead of 'application/vnd.ms-excel'. Added "\." to the mime character class + +1.114 + - Drop support for Perls older than 5.6.1. + +1.115 2014.10.19 + - Replace indirect calling of constructor both in code an documentation + with direct calling. + Write CGI::Simle->new instead of new CGI::Simple + - add tests to make sure the order of value is kept as they were passed in the QUERY_STRING + - new co-maintainer (SZABGAB( + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/MANIFEST new/CGI-Simple-1.115/MANIFEST --- old/CGI-Simple-1.113/MANIFEST 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/MANIFEST 2014-10-19 14:50:50.000000000 +0200 @@ -1,3 +1,4 @@ +.travis.yml Build.PL Changes inc/MyBuilder.pm @@ -6,8 +7,7 @@ lib/CGI/Simple/Standard.pm lib/CGI/Simple/Util.pm Makefile.PL -MANIFEST -META.yml +MANIFEST This list of files README t/000.load.t t/020.cookie.t @@ -27,4 +27,5 @@ t/pod.t t/test_file.txt t/upload_info.t -SIGNATURE Added here by Module::Build +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/META.json new/CGI-Simple-1.115/META.json --- old/CGI-Simple-1.113/META.json 1970-01-01 01:00:00.000000000 +0100 +++ new/CGI-Simple-1.115/META.json 2014-10-19 14:50:50.000000000 +0200 @@ -0,0 +1,42 @@ +{ + "abstract" : "A Simple totally OO CGI interface that is CGI.pm compliant", + "author" : [ + "Andy Armstrong <[email protected]>" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "CGI-Simple", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "IO::Scalar" : "0", + "Test::More" : "0" + } + } + }, + "release_status" : "stable", + "version" : "1.115" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/META.yml new/CGI-Simple-1.115/META.yml --- old/CGI-Simple-1.113/META.yml 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/META.yml 2014-10-19 14:50:50.000000000 +0200 @@ -2,32 +2,22 @@ abstract: 'A Simple totally OO CGI interface that is CGI.pm compliant' author: - 'Andy Armstrong <[email protected]>' +build_requires: + ExtUtils::MakeMaker: '0' configure_requires: - Module::Build: 0.36 -generated_by: 'Module::Build version 0.3607' + ExtUtils::MakeMaker: '0' +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + version: '1.4' name: CGI-Simple -provides: - CGI::Simple: - file: lib/CGI/Simple.pm - version: 1.113 - CGI::Simple::Cookie: - file: lib/CGI/Simple/Cookie.pm - version: 1.113 - CGI::Simple::Standard: - file: lib/CGI/Simple/Standard.pm - version: 1.113 - CGI::Simple::Util: - file: lib/CGI/Simple/Util.pm - version: 1.113 +no_index: + directory: + - t + - inc requires: - IO::Scalar: 0 - Test::More: 0 -resources: - bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=CGI-Simple - license: http://dev.perl.org/licenses/ - repository: 'git://github.com/AndyA/CGI--Simple.git (fetch)' -version: 1.113 + IO::Scalar: '0' + Test::More: '0' +version: '1.115' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/Makefile.PL new/CGI-Simple-1.115/Makefile.PL --- old/CGI-Simple-1.113/Makefile.PL 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/Makefile.PL 2014-10-19 14:50:40.000000000 +0200 @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; WriteMakefile( - ( MM->can( 'signature_target' ) ? ( SIGN => 1 ) : () ), + #( MM->can( 'signature_target' ) ? ( SIGN => 1 ) : () ), license( 'perl' ), NAME => 'CGI::Simple', AUTHOR => 'Andy Armstrong <[email protected]>', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/README new/CGI-Simple-1.115/README --- old/CGI-Simple-1.113/README 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/README 2014-09-10 22:05:56.000000000 +0200 @@ -1,4 +1,4 @@ -CGI-Simple version 1.113 +CGI-Simple version 1.114 INSTALLATION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/SIGNATURE new/CGI-Simple-1.115/SIGNATURE --- old/CGI-Simple-1.113/SIGNATURE 2010-12-27 14:11:22.000000000 +0100 +++ new/CGI-Simple-1.115/SIGNATURE 1970-01-01 01:00:00.000000000 +0100 @@ -1,52 +0,0 @@ -This file contains message digests of all files listed in MANIFEST, -signed via the Module::Signature module, version 0.66. - -To verify the content in this distribution, first make sure you have -Module::Signature installed, then type: - - % cpansign -v - -It will check each file's integrity, as well as the signature's -validity. If "==> Signature verified OK! <==" is not displayed, -the distribution may already have been compromised, and you should -not run its Makefile.PL or Build.PL. - ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -SHA1 e045be9cdb8db55f717cf79e924203e1414225f6 Build.PL -SHA1 1bd8b94957bfd7da59ef9807a45dc2d00e788ae4 Changes -SHA1 154204e3d020e794e62de630951ee023f3475876 MANIFEST -SHA1 ff5c3777e70cce70c0a57013ecb116f4eadc0655 META.yml -SHA1 95715f0bf53b6848943258a57e2ba3b06054b7b0 Makefile.PL -SHA1 10e555a784ad648e40b199025e99b781c1b5ecfa README -SHA1 8c97bbeb63b586ee9c722313c2ad7858e32ff52c inc/MyBuilder.pm -SHA1 3827cb87f45b8520fd33c90c0b6fc610477bdf1f lib/CGI/Simple.pm -SHA1 60b212aa1d5c324d5fd4b428a0509d7e37feb261 lib/CGI/Simple/Cookie.pm -SHA1 6fce2653ddeb7dad140b54e5917021c2ae22c1ab lib/CGI/Simple/Standard.pm -SHA1 407108f939abc700a7a415fc8db9ab3860882108 lib/CGI/Simple/Util.pm -SHA1 029a0c2274884058f99bc339fd5bb073348c2b77 t/000.load.t -SHA1 e66def005f5f56804341bbf6208d09636ce90763 t/020.cookie.t -SHA1 ca2ff8ba2f9a5f68c75e8d9527af38b042067148 t/030.function.t -SHA1 e8fbebb9354bcd7755bfecaa564f44467265242c t/040.request.t -SHA1 3678058ca2f62b397aab7560caeec6a06c4c1117 t/041.multipart.t -SHA1 1cb680ef671319e86103b7927c9d93b31d3d253b t/050.simple.t -SHA1 f77e6013c2de0bcf99c73c4af2ecc6220f7ec3a1 t/060.slow_post.t -SHA1 25f3447480a95a844b6f893ca47106788f8c19d8 t/070.standard.t -SHA1 4a7dade2334d9e4f5b223cbb6c9ebd49cb5cf4a3 t/080.util.t -SHA1 432c00d3873dd6c70998f18149ba7517ffb56602 t/090.14838.t -SHA1 73ac0f1550806696461a8c356aaff53393837aa7 t/100.set-cookie.t -SHA1 b068924cea067616ced5d01ce376a157caf701a1 t/110.bad-upload.t -SHA1 3091c116da74659dc33651d6bf2ce2f3c96eea12 t/headers.t -SHA1 8c049d1fe65af78a4c01ebcc7d81f37b65b15738 t/manifest.t -SHA1 d8b34ef82d206d0e64a5298a3d311ba2d87e29b9 t/pod-coverage.t -SHA1 0190346d7072d458c8a10a45c19f86db641dcc48 t/pod.t -SHA1 334f18ad2bd0fb8b8757d9607f9d0089bb88a1ee t/test_file.txt -SHA1 a232e5fa0fdc30997bdb22104c4b6eea45978b25 t/upload_info.t ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.11 (Darwin) - -iEYEARECAAYFAk0YkHcACgkQwoknRJZQnCGcegCgxnjuy2tsQhBxwSvKPPo7t6VC -6q8AoIAfVDbHZ2OcL1e8EXTTV+CgQig1 -=seUy ------END PGP SIGNATURE----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/lib/CGI/Simple/Cookie.pm new/CGI-Simple-1.115/lib/CGI/Simple/Cookie.pm --- old/CGI-Simple-1.113/lib/CGI/Simple/Cookie.pm 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/lib/CGI/Simple/Cookie.pm 2014-10-19 14:38:43.000000000 +0200 @@ -12,7 +12,7 @@ use strict; use vars '$VERSION'; -$VERSION = '1.113'; +$VERSION = '1.114'; use CGI::Simple::Util qw(rearrange unescape escape); use overload '""' => \&as_string, 'cmp' => \&compare, 'fallback' => 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/lib/CGI/Simple/Standard.pm new/CGI-Simple-1.115/lib/CGI/Simple/Standard.pm --- old/CGI-Simple-1.113/lib/CGI/Simple/Standard.pm 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/lib/CGI/Simple/Standard.pm 2014-09-10 22:05:56.000000000 +0200 @@ -7,7 +7,7 @@ $NO_UNDEF_PARAMS $USE_PARAM_SEMICOLONS $HEADERS_ONCE $NPH $DEBUG $NO_NULL $FATAL *in %EXPORT_TAGS $AUTOLOAD ); -$VERSION = "1.113"; +$VERSION = "1.114"; %EXPORT_TAGS = ( ':html' => [qw(:misc)], @@ -128,16 +128,16 @@ my $package = shift; my $sub = shift; if ( $sub eq '_cgi_object' ) { # for debugging get at the object - $q = new CGI::Simple( @_ ) unless $q; + $q = CGI::Simple->new( @_ ) unless $q; return $q; } if ( !$q or $sub eq 'restore_parameters' ) { if ( $sub eq 'restore_parameters' ) { - $q = new CGI::Simple( @_ ); + $q = CGI::Simple->new( @_ ); return; } else { - $q = new CGI::Simple; + $q = CGI::Simple->new; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/lib/CGI/Simple/Util.pm new/CGI-Simple-1.115/lib/CGI/Simple/Util.pm --- old/CGI-Simple-1.113/lib/CGI/Simple/Util.pm 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/lib/CGI/Simple/Util.pm 2014-09-10 22:05:56.000000000 +0200 @@ -1,7 +1,7 @@ package CGI::Simple::Util; use strict; use vars qw( $VERSION @EXPORT_OK @ISA $UTIL ); -$VERSION = '1.113'; +$VERSION = '1.114'; require Exporter; @ISA = qw( Exporter ); @EXPORT_OK = qw( @@ -237,7 +237,7 @@ # we do this on first initialization and store the results in in an object BEGIN { - $UTIL = new CGI::Simple::Util; # initialize our $UTIL object + $UTIL = CGI::Simple::Util->new; # initialize our $UTIL object sub new { my $class = shift; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/lib/CGI/Simple.pm new/CGI-Simple-1.115/lib/CGI/Simple.pm --- old/CGI-Simple-1.113/lib/CGI/Simple.pm 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/lib/CGI/Simple.pm 2014-10-19 14:38:27.000000000 +0200 @@ -1,6 +1,6 @@ package CGI::Simple; -require 5.004; +require 5.006001; # this module is both strict (and warnings) compliant, but they are only used # in testing as they add an unnecessary compile time overhead in production. @@ -13,7 +13,7 @@ $NPH $DEBUG $NO_NULL $FATAL *in ); -$VERSION = "1.113"; +$VERSION = "1.115"; # you can hard code the global variable settings here if you want. # warning - do not delete the unless defined $VAR part unless you @@ -781,14 +781,15 @@ seek $fh, 0, 0; # get ready for reading return $fh unless $writefile; my $buffer; - unless ( open OUT, ">$writefile" ) { + my $out; + unless ( open $out, '>', $writefile ) { $self->cgi_error( "500 Can't write to $writefile: $!\n" ); return undef; } - binmode OUT; + binmode $out; binmode $fh; - print OUT $buffer while read( $fh, $buffer, 4096 ); - close OUT; + print $out $buffer while read( $fh, $buffer, 4096 ); + close $out; $self->{'.filehandles'}->{$filename} = undef; undef $fh; return 1; @@ -1224,7 +1225,7 @@ sub _shift_if_ref { shift if ref $_[0] eq 'CGI::Simple' } sub ReadParse { - my $q = &_shift_if_ref || new CGI::Simple; + my $q = &_shift_if_ref || CGI::Simple->new; my $pkg = caller(); no strict 'refs'; *in @@ -1487,7 +1488,7 @@ =head1 VERSION -This document describes CGI::Simple version 1.113. +This document describes CGI::Simple version 1.114. =head1 SYNOPSIS @@ -1495,10 +1496,10 @@ $CGI::Simple::POST_MAX = 1024; # max upload via post default 100kB $CGI::Simple::DISABLE_UPLOADS = 0; # enable uploads - $q = new CGI::Simple; - $q = new CGI::Simple( { 'foo'=>'1', 'bar'=>[2,3,4] } ); - $q = new CGI::Simple( 'foo=1&bar=2&bar=3&bar=4' ); - $q = new CGI::Simple( \*FILEHANDLE ); + $q = CGI::Simple->new; + $q = CGI::Simple->new( { 'foo'=>'1', 'bar'=>[2,3,4] } ); + $q = CGI::Simple->new( 'foo=1&bar=2&bar=3&bar=4' ); + $q = CGI::Simple->new( \*FILEHANDLE ); $q->save( \*FILEHANDLE ); # save current object to a file as used by new @@ -1604,7 +1605,7 @@ You do that by using the module and then calling the new() constructor: use CGI::Simple; - my $q = new CGI::Simple; + my $q = CGI::Simple->new; It is traditional to call your object $q for query or perhaps $cgi. @@ -1634,6 +1635,9 @@ then it returns only the first value (if more than one value for 'foo' exists). +In case you ased for a list it will return all the values preserving the +order in which the values of the given key were passed in the request. + Most CGI::Simple routines accept several arguments, sometimes as many as 10 optional ones! To simplify this interface, all routines use a named argument calling style that looks like this: @@ -1738,7 +1742,7 @@ The first step in using CGI::Simple is to create a new query object using the B<new()> constructor: - $q = new CGI::Simple; + $q = CGI::Simple->new; This will parse the input (from both POST and GET methods) and store it into an object called $q. @@ -1746,11 +1750,15 @@ If you provide a file handle to the B<new()> method, it will read parameters from the file (or STDIN, or whatever). +Historically people were doing this way: + open FH, "test.in" or die $!; - $q = new CGI::Simple(\*FH); + $q = CGI::Simple->new(\*FH); + +but this is the recommended way: - open $fh, "test.in" or die $!; - $q = new CGI::Simple($fh); + open $fh, '<', "test.in" or die $!; + $q = CGI::Simple->new($fh); The file should be a series of newline delimited TAG=VALUE pairs. Conveniently, this type of file is created by the B<save()> method @@ -1762,7 +1770,7 @@ the way to do this is with B<restore_parameters()>. This will (re)initialize the default CGI::Simple object from the indicated file handle. - restore_parameters(\*FH); + restore_parameters($fh); In fact for all intents and purposes B<restore_parameters()> is identical to B<new()> Note that B<restore_parameters()> does not exist in @@ -1771,28 +1779,28 @@ You can also initialize the query object from an associative array reference: - $q = new CGI::Simple( { 'dinosaur' => 'barney', + $q = CGI::Simple->new( { 'dinosaur' => 'barney', 'song' => 'I love you', 'friends' => [qw/Jessica George Nancy/] } ); or from a properly formatted, URL-escaped query string: - $q = new CGI::Simple( 'dinosaur=barney&color=purple' ); + $q = CGI::Simple->new( 'dinosaur=barney&color=purple' ); or from a previously existing CGI::Simple object (this generates an identical clone including all global variable settings, etc that are stored in the object): - $old_query = new CGI::Simple; - $new_query = new CGI::Simple($old_query); + $old_query = CGI::Simple->new; + $new_query = CGI::Simple->new($old_query); To create an empty query, initialize it from an empty string or hash: - $empty_query = new CGI::Simple(""); + $empty_query = CGI::Simple->new(""); -or- - $empty_query = new CGI::Simple({}); + $empty_query = CGI::Simple->new({}); =head2 keywords() Fetching a list of keywords from a query @@ -1982,7 +1990,7 @@ this by calling B<parse_query_string()> which will add the QUERY_STRING data to the data already in our CGI::Simple object if the REQUEST_METHOD was 'POST' - $q = new CGI::Simple; + $q = CGI::Simple->new; $q->parse_query_string; # add $ENV{'QUERY_STRING'} data to our $q object If the REQUEST_METHOD was 'GET' then the QUERY_STRING will already be @@ -2011,9 +2019,9 @@ single = symbol. You can write out multiple records and read them back in with several calls to B<new()>. - open FH, "test.in" or die $!; - $q1 = new CGI::Simple(\*FH); # get the first record - $q2 = new CGI::Simple(\*FH); # get the next record + open my $fh, '<', "test.in" or die $!; + $q1 = CGI::Simple->new($fh); # get the first record + $q2 = CGI::Simple->new($fh); # get the next record Note: If you wish to use this method from the function-oriented (non-OO) interface, the exported name for this method is B<save_parameters()>. @@ -2021,7 +2029,7 @@ with B<restore_parameters()>. This will (re)initialize the default CGI::Simple object from the indicated file handle. - restore_parameters(\*FH); + restore_parameters($fh); =cut @@ -2071,10 +2079,10 @@ Now to save the file you would just do something like: $save_path = '/path/to/write/file.name'; - open FH, ">$save_path" or die "Oops $!\n"; - binmode FH; - print FH $buffer while read( $fh, $buffer, 4096 ); - close FH; + open my $out, '>', $save_path or die "Oops $!\n"; + binmode $out; + print $out $buffer while read( $fh, $buffer, 4096 ); + close $out; By utilizing a new feature of the upload method this process can be simplified to: @@ -2145,7 +2153,7 @@ use CGI::Simple; $CGI::Simple::DISABLE_UPLOADS = 0; - $q = new CGI::Simple; + $q = CGI::Simple->new; If you wish to set $DISABLE_UPLOADS you must do this *after* the use statement and *before* the new constructor call as shown above. @@ -2157,7 +2165,7 @@ use CGI::Simple; $CGI::Simple::DISABLE_UPLOADS = 0; # enable uploads $CGI::Simple::POST_MAX = 1_048_576; # allow 1MB uploads - $q = new CGI::Simple; + $q = CGI::Simple->new; If you set to -1 infinite size uploads will be permitted, which is the CGI.pm default. @@ -2359,7 +2367,7 @@ without the B<-value> parameter: use CGI::Simple; - $q = new CGI::Simple; + $q = CGI::Simple->new; $riddle = $q->cookie('riddle_name'); %answers = $q->cookie('answers'); @@ -3360,12 +3368,12 @@ &CGI::Simple::ReadParse; # get hash values in %in - my $q = new CGI::Simple; + my $q = CGI::Simple->new; $q->ReadParse(); # same thing CGI::Simple::ReadParse(*field); # get hash values in %field function style - my $q = new CGI::Simple; + my $q = CGI::Simple->new; $q->ReadParse(*field); # same thing Once you use B<ReadParse()> under the functional interface , you can retrieve diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/040.request.t new/CGI-Simple-1.115/t/040.request.t --- old/CGI-Simple-1.113/t/040.request.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/040.request.t 2014-09-10 22:05:56.000000000 +0200 @@ -2,7 +2,7 @@ # The only change is to change the use statement and change references # from CGI to CGI::Simple -use Test::More tests => 40; +use Test::More tests => 43; use strict; use Config; @@ -24,7 +24,7 @@ = "$ENV{SCRIPT_NAME}$ENV{PATH_INFO}?$ENV{QUERY_STRING}"; $ENV{HTTP_LOVE} = 'true'; -my $q = new CGI::Simple; +my $q = CGI::Simple->new; ok( $q, "CGI::Simple::new()" ); is( $q->request_method, 'GET', "CGI::Simple::request_method()" ); @@ -37,6 +37,8 @@ is( $q->param( 'game' ), 'chess', "CGI::Simple::param()" ); is( $q->param( 'weather' ), 'dull', "CGI::Simple::param()" ); +# ensuring that multiple values of the same param keep their original order in the param() call +# probably as a side effect of just testing other stuff is( join( ' ', $q->param( 'game' ) ), 'chess checkers', @@ -88,7 +90,7 @@ $q->_reset_globals; $ENV{QUERY_STRING} = 'mary+had+a+little+lamb'; -ok( $q = new CGI::Simple, "CGI::Simple::new() redux" ); +ok( $q = CGI::Simple->new, "CGI::Simple::new() redux" ); is( join( ' ', $q->keywords ), @@ -102,15 +104,15 @@ 'CGI::Simple::keywords' ); -ok $q = new CGI::Simple( 'foo=bar=baz' ), +ok $q = CGI::Simple->new( 'foo=bar=baz' ), 'CGI::Simple::new(), equals in value'; is $q->param( 'foo' ), 'bar=baz', 'parsed parameter containing equals'; -ok( $q = new CGI::Simple( 'foo=bar&foo=baz' ), +ok( $q = CGI::Simple->new( 'foo=bar&foo=baz' ), "CGI::Simple::new() redux" ); is( $q->param( 'foo' ), 'bar', 'CGI::Simple::param() redux' ); -ok( $q = new CGI::Simple( { 'foo' => 'bar', 'bar' => 'froz' } ), +ok( $q = CGI::Simple->new( { 'foo' => 'bar', 'bar' => 'froz' } ), "CGI::Simple::new() redux 2" ); is( $q->param( 'bar' ), 'froz', "CGI::Simple::param() redux 2" ); @@ -141,7 +143,7 @@ } # at this point, we're in a new (child) process - ok( $q = new CGI::Simple, "CGI::Simple::new() from POST" ); + ok( $q = CGI::Simple->new, "CGI::Simple::new() from POST" ); is( $q->param( 'weather' ), 'nice', "CGI::Simple::param() from POST" ); is( $q->url_param( 'big_balls' ), 'basketball', "CGI::url_param()" ); @@ -159,7 +161,7 @@ close CHILD; exit 0; } - ok( $q = new CGI::Simple, "CGI::Simple::new from POST" ); + ok( $q = CGI::Simple->new, "CGI::Simple::new from POST" ); is( $q->param( 'POSTDATA' ), $test_string, "CGI::Simple::param('POSTDATA') from POST" ); @@ -176,7 +178,7 @@ close CHILD; exit 0; } - ok( $q = new CGI::Simple, "CGI::Simple::new from POST" ); + ok( $q = CGI::Simple->new, "CGI::Simple::new from POST" ); is( $q->param( 'POSTDATA' ), $test_string, "CGI::Simple::param('POSTDATA') from POST w/nulls" ); @@ -193,7 +195,20 @@ close CHILD; exit 0; } - ok( $q = new CGI::Simple, "CGI::Simple::new from PUT" ); + ok( $q = CGI::Simple->new, "CGI::Simple::new from PUT" ); is( $q->param( 'PUTDATA' ), $test_string, "CGI::Simple::param('POSTDATA') from POST" ); } + + +{ + # ensuring multiple values of the same parameter preserve the order + $ENV{QUERY_STRING} = 'a=1&b=2&a=3&a=4&c=5&b=6'; + $ENV{REQUEST_METHOD} = 'GET'; + my $s = CGI::Simple->new; + is_deeply [$s->param( 'a' ) ], [1, 3, 4], 'multiple entries "a"'; + is_deeply [$s->param( 'b' ) ], [2, 6], 'multiple entries "b"'; + is_deeply [$s->param( 'c' ) ], [5], 'multiple entries "c"'; +} + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/041.multipart.t new/CGI-Simple-1.115/t/041.multipart.t --- old/CGI-Simple-1.113/t/041.multipart.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/041.multipart.t 2014-09-10 22:05:56.000000000 +0200 @@ -40,7 +40,7 @@ $ENV{CONTENT_LENGTH} = length $body; my $h = IO::Scalar->new( \$body ); -my $q = new CGI::Simple( $h ); +my $q = CGI::Simple->new( $h ); ok( $q, "CGI::Simple::new()" ); is_deeply( [ $q->param ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/050.simple.t new/CGI-Simple-1.115/t/050.simple.t --- old/CGI-Simple-1.113/t/050.simple.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/050.simple.t 2014-09-10 22:05:56.000000000 +0200 @@ -39,7 +39,7 @@ $ENV{'SERVER_PROTOCOL'} = 'HTTP/1.0'; $ENV{'SERVER_SOFTWARE'} = 'Apache - accept no substitutes'; -$q = new CGI::Simple; +$q = CGI::Simple->new; sub undef_globals { undef $CGI::Simple::USE_CGI_PM_DEFAULTS; @@ -158,7 +158,7 @@ is( $CGI::Simple::FATAL, -1, '_reset_globals(), 9' ); undef_globals(); -$q = new CGI::Simple; +$q = CGI::Simple->new; # url_decode() - scalar context, void argument $sv = $q->url_decode(); @@ -192,13 +192,13 @@ like( $q, qr/CGI::Simple/, 'new() plain constructor, 1' ); # new('') empty constructor -$q = new CGI::Simple( '' ); +$q = CGI::Simple->new( '' ); like( $q, qr/CGI::Simple/, 'new() empty constructor, 1' ); -$q = new CGI::Simple( {} ); +$q = CGI::Simple->new( {} ); like( $q, qr/CGI::Simple/, 'new() empty constructor, 2' ); # new() hash constructor -$q = new CGI::Simple( { 'foo' => '1', 'bar' => [ 2, 3, 4 ] } ); +$q = CGI::Simple->new( { 'foo' => '1', 'bar' => [ 2, 3, 4 ] } ); @av = $q->param; # fix OS bug with testing @@ -207,13 +207,13 @@ is( $q->param( 'bar' ), 2, 'new() hash constructor, 3' ); @av = $q->param( 'bar' ); is( join( '', @av ), 234, 'new() hash constructor, 4' ); -$q = new CGI::Simple( 'foo=1&bar=2&bar=3&bar=4' ); +$q = CGI::Simple->new( 'foo=1&bar=2&bar=3&bar=4' ); open FH, ">$tmpfile", or carp "Can't create $tmpfile $!\n"; $q->save( \*FH ); close FH; # new() query string constructor -$q = new CGI::Simple( 'foo=5&bar=6&bar=7&bar=8' ); +$q = CGI::Simple->new( 'foo=5&bar=6&bar=7&bar=8' ); @av = $q->param; is( join( ' ', @av ), 'foo bar', 'new() query string constructor, 1' ); is( $q->param( 'foo' ), 5, 'new() query string constructor, 2' ); @@ -226,8 +226,8 @@ # new() CGI::Simple object constructor -my $q_old = new CGI::Simple( 'foo=1&bar=2&bar=3&bar=4' ); -my $q_new = new CGI::Simple( $q_old ); +my $q_old = CGI::Simple->new( 'foo=1&bar=2&bar=3&bar=4' ); +my $q_new = CGI::Simple->new( $q_old ); is( $q_old->query_string, 'foo=1&bar=2&bar=3&bar=4', 'new() CGI::Simple object constructor, 1' ); is( $q_new->query_string, 'foo=1&bar=2&bar=3&bar=4', @@ -238,7 +238,7 @@ $ENV{'REQUEST_METHOD'} = ''; $CGI::Simple::DEBUG = 1; @ARGV = qw( foo=bar\=baz foo=bar\&baz ); -$q = new CGI::Simple; +$q = CGI::Simple->new; is( join( ' ', $q->param( 'foo' ) ), @@ -249,7 +249,7 @@ ################ The Core Methods ################ -$q = new CGI::Simple; +$q = CGI::Simple->new; # param() - scalar and array context, void argument $sv = $q->param(); @@ -290,7 +290,7 @@ is( $sv, undef, 'param( -name=>\'invalid\' ) get values, 1' ); is( join( ' ', @av ), '', 'param( -name=>\'invalid\' ) get values, 2' ); $CGI::Simple::NO_UNDEF_PARAMS = 0; -$q = new CGI::Simple( 'name=&color=' ); +$q = CGI::Simple->new( 'name=&color=' ); # param() - scalar and array context, void values void arg $sv = $q->param(); @@ -304,7 +304,7 @@ is( $sv, '', 'param(\'name\') void values 1, valid param, 1' ); is( join( ' ', @av ), '', 'param(\'name\') void values 1, valid param, 2' ); -$q = new CGI::Simple( 'name&color' ); +$q = CGI::Simple->new( 'name&color' ); # param() - scalar and array context, void values void arg $sv = $q->param(); @@ -319,7 +319,7 @@ is( join( ' ', @av ), '', 'param(\'name\') void values 2 , valid param, 2' ); $CGI::Simple::NO_UNDEF_PARAMS = 1; -$q = new CGI::Simple( 'name=&color=' ); +$q = CGI::Simple->new( 'name=&color=' ); # param() - scalar and array context, void values void arg $sv = $q->param(); @@ -334,7 +334,7 @@ 'param(\'name\') void values 1, valid param, no undef, 1' ); is( join( ' ', @av ), '', 'param(\'name\') void values 1, valid param, no undef, 2' ); -$q = new CGI::Simple( 'name&color' ); +$q = CGI::Simple->new( 'name&color' ); # param() - scalar and array context, void values void arg $sv = $q->param(); @@ -350,7 +350,7 @@ is( join( ' ', @av ), '', 'param(\'name\') void values 2, valid param, no undef, 2' ); $CGI::Simple::NO_UNDEF_PARAMS = 0; -$q = new CGI::Simple; +$q = CGI::Simple->new; # param() - scalar and array context, set values $sv = $q->param( 'foo', 'some', 'new', 'values' ); @@ -460,7 +460,7 @@ '', 'url_param(\'invalid\') single argument (invalid), 2' ); # keywords() - scalar and array context, void argument -$q = new CGI::Simple( 'here+are++++some%20keywords' ); +$q = CGI::Simple->new( 'here+are++++some%20keywords' ); $sv = $q->keywords; @av = $q->keywords; is( $sv, '4', 'keywords(), 1' ); @@ -474,7 +474,7 @@ 'foo bar baz', 'keywords( \'foo\', \'bar\', \'baz\' ), 2' ); # keywords() - scalar and array context, array ref argument -$q = new CGI::Simple; +$q = CGI::Simple->new; $sv = $q->keywords( [ 'foo', 'man', 'chu' ] ); @av = $q->keywords( [ 'foo', 'man', 'chu' ] ); is( $sv, '3', 'keywords( [\'foo\', \'man\', \'chu\'] ), 1' ); @@ -485,7 +485,7 @@ $sv->{'color'} = "foo\0bar\0baz"; is( join( ' ', $q->param( 'color' ) ), 'foo bar baz', 'Vars() - tied interface, 2' ); -$q = new CGI::Simple; +$q = CGI::Simple->new; # Vars() - hash context, void argument my %hv = $q->Vars(); @@ -577,7 +577,7 @@ is( join( '', $q->param ), '', 'delete_all(), 1' ); is( $q->globals, '11', 'delete_all(), 2' ); $ENV{'CONTENT_TYPE'} = 'NOT multipart/form-data'; -$q = new CGI::Simple; +$q = CGI::Simple->new; # delete_all() - scalar and array context, void/invalid/valid argument is( join( ' ', $q->param ), 'name color', 'Delete_all(), 1' ); @@ -642,7 +642,7 @@ unlink $tmpfile, "$tmpfile.bak"; $ENV{'CONTENT_TYPE'} = 'application/x-www-form-urlencoded'; -$q = new CGI::Simple; +$q = CGI::Simple->new; # query_string() - scalar and array context, void/invalid/valid argument $sv = $q->query_string(); @@ -685,7 +685,7 @@ ################ Miscelaneous Methods ################ -$q = new CGI::Simple; +$q = CGI::Simple->new; # escapeHTML() $sv = $q->escapeHTML(); @@ -724,7 +724,7 @@ is( $q->print( '' ), 1, 'print(), 1' ); ################# Cookie Methods ################ -$q = new CGI::Simple; +$q = CGI::Simple->new; # raw_cookie() - scalar and array context, void argument $sv = $q->raw_cookie(); @@ -833,7 +833,7 @@ ); ################# Header Methods ################ -$q = new CGI::Simple +$q = CGI::Simple->new; my $CRLF = $q->crlf; @@ -1006,13 +1006,13 @@ CGI::Simple::ReadParse(); is( $in{'name'}, 'JaPh,', 'ReadParse(), 1' ); %in = (); -$q = new CGI::Simple; +$q = CGI::Simple->new; $q->ReadParse(); is( $in{'name'}, 'JaPh,', 'ReadParse(), 2' ); CGI::Simple::ReadParse( *field ); is( $field{'name'}, 'JaPh,', 'ReadParse(), 3' ); %field = (); -$q = new CGI::Simple; +$q = CGI::Simple->new; $q->ReadParse( *field ); is( $field{'name'}, 'JaPh,', 'ReadParse(), 4' ); $q = $field{'CGI'}; @@ -1105,7 +1105,7 @@ ################ Accessor Methods ################ -$q = new CGI::Simple; +$q = CGI::Simple->new; # version() - scalar context, void argument like( $q->version(), qr/[\d\.]+/, 'version(), 1' ); @@ -1351,7 +1351,7 @@ #$CGI::Simple::POST_MAX = 20; #$ENV{'REQUEST_METHOD'} = 'POST'; -#$q = new CGI::Simple; +#$q = CGI::Simple->new; #is( $q->cgi_error, '413 Request entity too large: 42 bytes on STDIN exceeds $POST_MAX!' , 'Yet more tests, 1'); $ENV{'REQUEST_METHOD'} = 'HEAD'; @@ -1360,7 +1360,7 @@ = 'name=JAPH&color=red&color=green&color=blue'; $CGI::Simple::POST_MAX = 50; -$q = new CGI::Simple; +$q = CGI::Simple->new; @av = $q->param; is( join( ' ', @av ), 'name color', 'Yet more tests, 2' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/060.slow_post.t new/CGI-Simple-1.115/t/060.slow_post.t --- old/CGI-Simple-1.113/t/060.slow_post.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/060.slow_post.t 2014-09-10 22:05:56.000000000 +0200 @@ -30,7 +30,7 @@ } # at this point, we're in a new (child) process - $q = new CGI::Simple; + $q = CGI::Simple->new; $sv = $q->param( 'SLOW' ); is( length $sv, 10_000, 'length ok' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/070.standard.t new/CGI-Simple-1.115/t/070.standard.t --- old/CGI-Simple-1.113/t/070.standard.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/070.standard.t 2014-09-10 22:05:56.000000000 +0200 @@ -824,7 +824,7 @@ ################# Header Methods ################ -$q = new CGI::Simple +$q = CGI::Simple->new; my $CRLF = crlf(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/090.14838.t new/CGI-Simple-1.115/t/090.14838.t --- old/CGI-Simple-1.113/t/090.14838.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/090.14838.t 2014-09-10 22:05:56.000000000 +0200 @@ -36,6 +36,6 @@ $CGI::Simple::DISABLE_UPLOADS = 0; -my $q = new CGI::Simple; +my $q = CGI::Simple->new; is $q->cgi_error, undef, "CGI::Simple can handle this"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/110.bad-upload.t new/CGI-Simple-1.115/t/110.bad-upload.t --- old/CGI-Simple-1.113/t/110.bad-upload.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/110.bad-upload.t 2014-09-10 22:05:56.000000000 +0200 @@ -39,6 +39,6 @@ exit 0; } -my $q = new CGI::Simple; +my $q = CGI::Simple->new; is( $q->cgi_error, undef, "CGI::Simple can handle this" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/manifest.t new/CGI-Simple-1.115/t/manifest.t --- old/CGI-Simple-1.113/t/manifest.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/manifest.t 2014-10-19 14:45:52.000000000 +0200 @@ -1,19 +1,10 @@ -#!perl - use strict; use warnings; - use Test::More; - -eval { require ExtUtils::Manifest }; -plan skip_all => 'No ExtUtils::Manifest' if $@; -plan skip_all => 'No MANIFEST.SKIP' unless -f 'MANIFEST.SKIP'; -plan tests => 2; - -my ( $missing, $extra ) = ExtUtils::Manifest::fullcheck(); - -is_deeply $missing, [], 'missing files'; -is_deeply $extra, [], 'extra files'; + +eval 'use Test::DistManifest 1.012'; +plan skip_all => 'Test::DistManifest 1.012 required to test MANIFEST' if $@; +manifest_ok(); # vim:ts=2:sw=2:et:ft=perl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CGI-Simple-1.113/t/upload_info.t new/CGI-Simple-1.115/t/upload_info.t --- old/CGI-Simple-1.113/t/upload_info.t 2010-12-27 14:11:19.000000000 +0100 +++ new/CGI-Simple-1.115/t/upload_info.t 2014-09-10 22:05:56.000000000 +0200 @@ -45,7 +45,7 @@ $ENV{CONTENT_LENGTH} = length $body; my $h = IO::Scalar->new( \$body ); -my $q = new CGI::Simple( $h ); +my $q = CGI::Simple->new( $h ); ok( $q->upload_info( $q->param( 'file0' ), 'mime' ) eq 'image/png', 'Guess mime for image/png' ); ok( $q->upload_info( $q->param( 'file1' ), 'mime' ) eq 'image/svg+xml',
