/usr/lib/x86_64-linux-gnu/perl5/5.24/CGI/Struct/XS.pm is in libcgi-struct-xs-perl 1.04-2+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | use warnings;
use strict;
package CGI::Struct::XS;
use XSLoader;
use Exporter qw(import);
use Storable qw(dclone);
our $VERSION = 1.04;
our @EXPORT = qw(build_cgi_struct);
XSLoader::load(__PACKAGE__, $VERSION);
1;
__END__
=head1 NAME
CGI::Struct::XS - Build structures from CGI data. Fast.
=head1 DESCRIPTION
This module is XS implementation of L<CGI::Struct>.
It's fully compatible with L<CGI::Struct>, except for error messages.
C<CGI::Struct::XS> is 3-15 (5-25 with dclone disabled) times faster than original module.
=head1 SYNOPSIS
use CGI;
use CGI::Struct::XS;
my $cgi = CGI->new;
my %params = $cgi->Vars;
my $struct = build_cgi_struct \%params;
...
Or
use Plack::Request;
use CGI::Struct::XS;
my $app_or_middleware = sub {
my $env = shift; # PSGI env
my $req = Plack::Request->new($env);
my $errs = [];
my $struct = build_cgi_struct $req->parameters, $errs, { dclone => 0 };
...
}
=head1 FUNCTIONS
=head2 build_cgi_struct
$struct = build_cgi_struct \%params;
$struct = build_cgi_struct \%params, \@errs;
$struct = build_cgi_struct \%params, \@errs, \%conf;
The only exported function is C<build_cgi_struct>.
It has three arguments:
=over
=item C<\%params>
HashRef with input values. Typicaly this is CGI or Plack params hashref
=item C<\@errs>
ArrayRef to store error messages.
If it's not defined all parsing errors will be sielently discarded.
=item C<\%conf>
HashRef with parsing optiosn
=back
Following options are supported:
=over
=item C<nodot>
Treat dot as ordinary character, not hash delimeter
=item C<nullsplit>
Split input values by C<\\0> character, useful for old CGI libraries
=item C<dclone>
Store deep clone of value, instead of original value.
This opion increase memory consumsion and slows parsing.
It's recomended to disable dclone, because in most cases CGI params are used as read-only variables.
=back
=head1 SEE ALSO
L<CGI::Struct>
|