CGI-Minimal

 view release on metacpan or  search on metacpan

lib/CGI/Minimal.pod  view on Meta::CPAN

=cut

######################################################################

=over 4

=item new;

Creates a new instance of the CGI::Minimal object and decodes
any type of form (GET/POST). Only one 'true' object is generated -
all subsequent calls return an alias of the one object (a 'Singleton'
pattern).

Example:

 use CGI::Minimal;

 my $cgi = CGI::Minimal->new;

=back

=cut

=over 4

=item param([$fieldname]);

Called as C<$cgi-E<gt>param();> it returns the list of all defined
form fields in the same order they appear in the data from the
user agent.

Called as C<$cgi-E<gt>param($fieldname);> it returns the value (or
array of values for multiple occurances of the same field name) assigned
to that $fieldname. If there is more than one value, the values are
returned in the same order they appeared in the data from user agent.

Examples:

  my (@form_fields) = $cgi->param;

  my (@multi_pick_field) = $cgi->param('pick_field_name');

  my ($form_field_value) = $cgi->param('some_field_name');

You can also use the param method to set param values to new values.
These values will be returned by any invokation of a CGI::Minimal object
as if they had been found in the original passed data.

Examples:

    $cgi->param( 'name' => 'Joe Shmoe' );

    $cgi->param({ 'name' => 'Joe Shmoe', 'birth_date' => '06/25/1966' });

    $cgi->param({ 'pick_list' => ['01','05','07'] });

Starting with the 1.12 version, CGI::Minimal accepts the ';' character
as a form field seperator in addition to the '&'.

IOW: a=b;c=d will decode as well as a=b&c=d in form submissions. This is
to provide SGML/XML/XHTML compatibility for those needing it. Since ';' has
always been escaped to %3e by the url_encode method, this should only affect
people who are already doing the wrong thing with their forms by
not escaping their data correctly. This is also compatible with what the CGI.pm
module does.

=back

=cut

=over 4

=item delete_all;

This is functionally equivalent to the CGI.pm 'delete_all' method. It clears
all currently set param values. It B<is not> the same as the static method
C<reset_globals> because it does not reset the C<raw>, C<max_read_size>,  C<truncated>
states or reintialize the form decoding configuration for reuse.

It just deletes all the parameters.

Ex.

   $cgi->delete_all;

=back

=cut

=over 4

=item delete(@param_names);

This allows you to delete specified parameters from the CGI::Minimal
object.

Ex.
   $cgi->delete('fieldname', 'another');

=back

=cut

=over 4

=item param_mime([$fieldname]);

Called as C<$cgi-E<gt>param_mime();> it returns the list of all defined
form fields in the same order they appear in the data from the
user agent.

Called as C<$cgi-E<gt>param_mime($fieldname);> it returns the MIME
type (or array of MIME types for multiple occurances of the same field
name) assigned to that $fieldname. If there is more than one value, the
values are returned in the same order they appeared in the data from user
agent.

This is only meaningful when doing Form Based File Uploads and
should probably not be trusted even then since it depends on the
_browser_ correctly identifying what it is sending.



( run in 0.687 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )