Template-Plugin-CGI-3.101/0000755000000000000000000000000014232267332013627 5ustar rootrootTemplate-Plugin-CGI-3.101/LICENSE0000644000000000000000000000205514232267332014636 0ustar rootrootMIT License Copyright (c) 2022 Andy Wardley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Template-Plugin-CGI-3.101/Changes0000644000000000000000000000127714232267332015131 0ustar rootroot#======================================================================== # # Changes # # DESCRIPTION # Revision history for the Template::Plugin::CGI # # AUTHOR # Sawyer X # #======================================================================== #----------------------------------------------------------------------- # Version 3.101 - 27th April 2022 #------------------------------------------------------------------------ Fixes: * Include dependency on Template. #----------------------------------------------------------------------- # Version 3.100 - 25th April 2022 #------------------------------------------------------------------------ Improvements: * Exists Template-Plugin-CGI-3.101/t/0000755000000000000000000000000014232267332014072 5ustar rootrootTemplate-Plugin-CGI-3.101/t/cgi.t0000644000000000000000000000416114232267332015023 0ustar rootroot#============================================================= -*-perl-*- # # t/cgi.t # # Test the CGI plugin. # # Written by Andy Wardley # # Copyright (C) 1996-2000 Andy Wardley. All Rights Reserved. # Copyright (C) 1998-2000 Canon Research Centre Europe Ltd. # # This is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # # $Id$ # #======================================================================== use strict; use lib qw( ../lib ); use Template; use Template::Test; $^W = 1; #$Template::Parser::DEBUG = 1; #$Template::Parser::PRETTY = 1; #$Template::Stash::DEBUG = 1; eval "use CGI"; if ($@) { skip_all("no CGI module"); } my $cgi = CGI->new(''); $cgi = join( "\n", $cgi->checkbox_group( -name => 'words', -values => [ 'eenie', 'meenie', 'minie', 'moe' ], -defaults => [ 'eenie', 'meenie' ], ) ); test_expect( \*DATA, undef, { cgicheck => $cgi, barf => \&barf } ); sub barf { carp('failed'); } __END__ -- test -- [% USE scalar -%] [% USE cgi = CGI('id=abw&name=Andy+Wardley'); global.cgi = cgi -%] name: [% global.cgi.scalar.param('name') %] -- expect -- name: Andy Wardley -- test -- [% USE scalar -%] name: [% global.cgi.scalar.param('name') %] -- expect -- name: Andy Wardley -- test -- [% USE scalar -%] [% FOREACH key = global.cgi.param.sort -%] * [% key %] : [% global.cgi.scalar.param(key) %] [% END %] -- expect -- * id : abw * name : Andy Wardley -- test -- [% USE scalar -%] [% FOREACH key = global.cgi.param().sort -%] * [% key %] : [% global.cgi.scalar.param(key) %] [% END %] -- expect -- * id : abw * name : Andy Wardley -- test -- [% FOREACH x = global.cgi.checkbox_group( name => 'words' values => [ 'eenie', 'meenie', 'minie', 'moe' ] defaults => [ 'eenie', 'meenie' ] ) -%] [% x %] [% END %] -- expect -- -- process -- [% cgicheck %] -- test -- [% USE cgi('item=foo&items=one&items=two') -%] item: [% cgi.params.item %] item: [% cgi.params.item.join(', ') %] items: [% cgi.params.items.join(', ') %] -- expect -- item: foo item: foo items: one, two Template-Plugin-CGI-3.101/t/00-compile.t0000644000000000000000000000264414232267332016132 0ustar rootrootuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Template/Plugin/CGI.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; Template-Plugin-CGI-3.101/t/author-no-tabs.t0000644000000000000000000000103514232267332017121 0ustar rootroot BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/Template/Plugin/CGI.pm', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/author-distmeta.t', 't/author-no-tabs.t', 't/author-pod-syntax.t', 't/cgi.t' ); notabs_ok($_) foreach @files; done_testing; Template-Plugin-CGI-3.101/t/author-distmeta.t0000644000000000000000000000037414232267332017375 0ustar rootroot#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); Template-Plugin-CGI-3.101/t/author-pod-syntax.t0000644000000000000000000000045414232267332017670 0ustar rootroot#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Template-Plugin-CGI-3.101/t/00-report-prereqs.t0000644000000000000000000001345214232267332017473 0ustar rootroot#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.028 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: Template-Plugin-CGI-3.101/t/00-report-prereqs.dd0000644000000000000000000000342014232267332017611 0ustar rootrootdo { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' } }, 'develop' => { 'requires' => { 'Test::CPAN::Meta' => '0', 'Test::More' => '0.88', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41' } }, 'runtime' => { 'requires' => { 'CGI' => '4.44' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'File::Temp' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Template' => '3.100', 'Test2::Bundle::Extended' => '0', 'Test2::Plugin::NoWarnings' => '0', 'Test2::Suite' => '0', 'Test2::Tools::Explain' => '0', 'Test::Builder' => '0', 'Test::CPAN::Meta' => '0', 'Test::More' => '0' } } }; $x; }Template-Plugin-CGI-3.101/cpanfile0000644000000000000000000000114214232267332015331 0ustar rootroot# Template::Plugin::CGI requires "CGI" => ">= 4.44"; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; }; on "test" => sub { requires "File::Temp" => 0; requires "Test2::Bundle::Extended" => 0; requires "Test2::Plugin::NoWarnings" => 0; requires "Test2::Suite" => 0; requires "Test2::Tools::Explain" => 0; requires "Test::Builder" => 0; requires "Test::CPAN::Meta" => 0; requires "Test::More" => 0; requires "Template" => "3.100"; }; Template-Plugin-CGI-3.101/META.yml0000644000000000000000000000216414232267332015103 0ustar rootroot--- abstract: 'Simple Template Toolkit plugin interfacing to the CGI.pm module' author: - 'Andy Wardley' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' File::Temp: '0' IO::Handle: '0' IPC::Open3: '0' Template: '3.100' Test2::Bundle::Extended: '0' Test2::Plugin::NoWarnings: '0' Test2::Suite: '0' Test2::Tools::Explain: '0' Test::Builder: '0' Test::CPAN::Meta: '0' Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010' license: mit meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Template-Plugin-CGI provides: Template::Plugin::CGI: file: lib/Template/Plugin/CGI.pm version: '3.101' requires: CGI: '4.44' resources: bugtracker: https://github.com/xsawyerx/template-plugin-cgi/issues homepage: http://template-toolkit.org repository: git://github.com/xsawyerx/template-plugin-cgi.git version: '3.101' x_authority: cpan:TODDR x_generated_by_perl: v5.32.0 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: MIT Template-Plugin-CGI-3.101/MANIFEST0000644000000000000000000000047714232267332014770 0ustar rootroot# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.017. Changes LICENSE MANIFEST META.json META.yml Makefile.PL cpanfile cpanfile.plugins lib/Template/Plugin/CGI.pm t/00-compile.t t/00-report-prereqs.dd t/00-report-prereqs.t t/author-distmeta.t t/author-no-tabs.t t/author-pod-syntax.t t/cgi.t Template-Plugin-CGI-3.101/META.json0000644000000000000000000000423014232267332015247 0ustar rootroot{ "abstract" : "Simple Template Toolkit plugin interfacing to the CGI.pm module", "author" : [ "Andy Wardley" ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010", "license" : [ "mit" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Template-Plugin-CGI", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Test::CPAN::Meta" : "0", "Test::More" : "0.88", "Test::NoTabs" : "0", "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "CGI" : "4.44" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "File::Temp" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Template" : "3.100", "Test2::Bundle::Extended" : "0", "Test2::Plugin::NoWarnings" : "0", "Test2::Suite" : "0", "Test2::Tools::Explain" : "0", "Test::Builder" : "0", "Test::CPAN::Meta" : "0", "Test::More" : "0" } } }, "provides" : { "Template::Plugin::CGI" : { "file" : "lib/Template/Plugin/CGI.pm", "version" : "3.101" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/xsawyerx/template-plugin-cgi/issues" }, "homepage" : "http://template-toolkit.org", "repository" : { "type" : "git", "url" : "git://github.com/xsawyerx/template-plugin-cgi.git", "web" : "https://github.com/xsawyerx/template-plugin-cgi" } }, "version" : "3.101", "x_authority" : "cpan:TODDR", "x_generated_by_perl" : "v5.32.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.24", "x_spdx_expression" : "MIT" } Template-Plugin-CGI-3.101/Makefile.PL0000644000000000000000000000320114232267332015575 0ustar rootroot# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.017. use strict; use warnings; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Simple Template Toolkit plugin interfacing to the CGI.pm module", "AUTHOR" => "Andy Wardley", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Template-Plugin-CGI", "LICENSE" => "mit", "NAME" => "Template::Plugin::CGI", "PREREQ_PM" => { "CGI" => "4.44" }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "File::Temp" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Template" => "3.100", "Test2::Bundle::Extended" => 0, "Test2::Plugin::NoWarnings" => 0, "Test2::Suite" => 0, "Test2::Tools::Explain" => 0, "Test::Builder" => 0, "Test::CPAN::Meta" => 0, "Test::More" => 0 }, "VERSION" => "3.101", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "CGI" => "4.44", "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "File::Temp" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Template" => "3.100", "Test2::Bundle::Extended" => 0, "Test2::Plugin::NoWarnings" => 0, "Test2::Suite" => 0, "Test2::Tools::Explain" => 0, "Test::Builder" => 0, "Test::CPAN::Meta" => 0, "Test::More" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Template-Plugin-CGI-3.101/cpanfile.plugins0000644000000000000000000000205114232267332017011 0ustar rootroot# Template::Plugin::CGI requires "CGI" => ">= 4.44"; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; }; on "test" => sub { requires "File::Temp" => 0; requires "Test2::Bundle::Extended" => 0; requires "Test2::Plugin::NoWarnings" => 0; requires "Test2::Suite" => 0; requires "Test2::Tools::Explain" => 0; requires "Test::Builder" => 0; requires "Test::CPAN::Meta" => 0; requires "Test::More" => 0; requires "Test::NoWarnings" => 0; # required for testing some plugins on 5.8 requires "Module::Build" => 0; requires "Test::Pod" => 0; requires "Test::Pod::Coverage" => 0; requires "Test::Warnings" => 0; requires "Pod::Coverage::TrustPod" => 0; requires "DateTime::Format::Mail" => 0; requires "DateTime::Format::W3CDTF" => 0; requires "XML::Parser" => 0; }; Template-Plugin-CGI-3.101/lib/0000755000000000000000000000000014232267332014375 5ustar rootrootTemplate-Plugin-CGI-3.101/lib/Template/0000755000000000000000000000000014232267332016150 5ustar rootrootTemplate-Plugin-CGI-3.101/lib/Template/Plugin/0000755000000000000000000000000014232267332017406 5ustar rootrootTemplate-Plugin-CGI-3.101/lib/Template/Plugin/CGI.pm0000644000000000000000000000673514232267332020361 0ustar rootroot#============================================================= -*-Perl-*- # # Template::Plugin::CGI # # DESCRIPTION # Simple Template Toolkit plugin interfacing to the CGI.pm module. # # AUTHOR # Andy Wardley # # COPYRIGHT # Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved. # # This module is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # #============================================================================ package Template::Plugin::CGI; our $AUTHORITY = 'cpan:TODDR'; # ABSTRACT: Simple Template Toolkit plugin interfacing to the CGI.pm module $Template::Plugin::CGI::VERSION = '3.101'; use strict; use warnings; use base 'Template::Plugin'; use CGI; sub new { my $class = shift; my $context = shift; CGI->new(@_); } # monkeypatch CGI::params() method to Do The Right Thing in TT land sub CGI::params { my $self = shift; local $" = ', '; return $self->{ _TT_PARAMS } ||= do { # must call Vars() in a list context to receive # plain list of key/vals rather than a tied hash my $params = { $self->Vars() }; # convert any null separated values into lists @$params{ keys %$params } = map { /\0/ ? [ split /\0/ ] : $_ } values %$params; $params; }; } 1; =pod =encoding UTF-8 =head1 NAME Template::Plugin::CGI - Simple Template Toolkit plugin interfacing to the CGI.pm module =head1 VERSION version 3.101 =head1 SYNOPSIS [% USE CGI %] [% CGI.param('parameter') %] [% USE things = CGI %] [% things.param('name') %] # see CGI docs for other methods provided by the CGI object =head1 DESCRIPTION This is a very simple Template Toolkit Plugin interface to the C module. A C object will be instantiated via the following directive: [% USE CGI %] C methods may then be called as follows: [% CGI.header %] [% CGI.param('parameter') %] An alias can be used to provide an alternate name by which the object should be identified. [% USE mycgi = CGI %] [% mycgi.start_form %] [% mycgi.popup_menu({ Name => 'Color' Values => [ 'Green' 'Black' 'Brown' ] }) %] Parenthesised parameters to the C directive will be passed to the plugin constructor: [% USE cgiprm = CGI('uid=abw&name=Andy+Wardley') %] [% cgiprm.param('uid') %] =head1 NAME Template::Plugin::CGI - Interface to the CGI module =head1 METHODS In addition to all the methods supported by the C module, this plugin defines the following. =head2 params() This method returns a reference to a hash of all the C parameters. Any parameters that have multiple values will be returned as lists. [% USE CGI('user=abw&item=foo&item=bar') %] [% CGI.params.user %] # abw [% CGI.params.item.join(', ') %] # foo, bar =head1 AUTHOR Andy Wardley Eabw@wardley.orgE L =head1 COPYRIGHT Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L, L =head1 AUTHOR Andy Wardley =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2022 by Andy Wardley. This is free software, licensed under: The MIT (X11) License =cut __END__ # Local Variables: # mode: perl # perl-indent-level: 4 # indent-tabs-mode: nil # End: # # vim: expandtab shiftwidth=4: