Apache2-SSI
view release on metacpan or search on metacpan
See also "apache_filter_handler"
clone
Create a clone of the object and return it.
decode_base64
Decode base64 data provided. When running under Apache mod_perl, this
uses "decode" in APR::Base64 module, otherwise it uses "decode" in
MIME::Base64
If the decoded data contain utf8 data, this will decoded the utf8 data
using "decode" in Encode
If an error occurred during decoding, it will return undef and set an
"error" object accordingly.
decode_entities
Decode html data containing entities. This uses "decode_entities" in
HTML::Entities
If an error occurred during decoding, it will return undef and set an
sizefmt
Sets or gets the formatting for file sizes. Value can be either "bytes"
or "abbrev"
timefmt
Sets or gets the formatting for date and time values. The format takes
the same values as "strftime" in POSIX
Encoding
At present time, the html data are treated as utf8 data and decoded and
encoded back as such.
If there is a need to broaden support for other charsets, let me know.
SSI Directives
This is taken from Apache documentation and summarised here for
convenience and clarity to the perl community.
config
<!--#config errmsg="Error occurred" sizefmt="abbrev" timefmt="%B %Y" -->
decode\_base64
--------------
Decode base64 data provided. When running under Apache mod\_perl, this
uses [\"decode\" in
APR::Base64](https://metacpan.org/pod/APR::Base64#decode){.perl-module}
module, otherwise it uses [\"decode\" in
MIME::Base64](https://metacpan.org/pod/MIME::Base64#decode){.perl-module}
If the decoded data contain utf8 data, this will decoded the utf8 data
using [\"decode\" in
Encode](https://metacpan.org/pod/Encode#decode){.perl-module}
If an error occurred during decoding, it will return undef and set an
[\"error\"](#error){.perl-module} object accordingly.
decode\_entities
----------------
Decode html data containing entities. This uses [\"decode\_entities\" in
timefmt
-------
Sets or gets the formatting for date and time values. The format takes
the same values as [\"strftime\" in
POSIX](https://metacpan.org/pod/POSIX#strftime){.perl-module}
Encoding
========
At present time, the html data are treated as utf8 data and decoded and
encoded back as such.
If there is a need to broaden support for other charsets, let me know.
SSI Directives
==============
This is taken from Apache documentation and summarised here for
convenience and clarity to the perl community.
lib/Apache2/SSI.pm view on Meta::CPAN
See also L</apache_filter_handler>
=head2 clone
Create a clone of the object and return it.
=head2 decode_base64
Decode base64 data provided. When running under Apache mod_perl, this uses L<APR::Base64/decode> module, otherwise it uses L<MIME::Base64/decode>
If the decoded data contain utf8 data, this will decode the utf8 data using L<Encode/decode>
If an error occurred during decoding, it will return undef and set an L</error> object accordingly.
=head2 decode_entities
Decode html data containing entities. This uses L<HTML::Entities/decode_entities>
If an error occurred during decoding, it will return undef and set an L</error> object accordingly.
Example:
lib/Apache2/SSI.pm view on Meta::CPAN
=head2 sizefmt
Sets or gets the formatting for file sizes. Value can be either C<bytes> or C<abbrev>
=head2 timefmt
Sets or gets the formatting for date and time values. The format takes the same values as L<POSIX/strftime>
=head1 Encoding
At present time, the html data are treated as utf8 data and decoded and encoded back as such.
If there is a need to broaden support for other charsets, let me know.
=head1 SSI Directives
This is taken from Apache documentation and summarised here for convenience and clarity to the perl community.
=head2 config
<!--#config errmsg="Error occurred" sizefmt="abbrev" timefmt="%B %Y" -->
lib/Apache2/SSI/Common.pm view on Meta::CPAN
=item I<binmode>
my $content = $uri->slurp({ binmode => ':utf-8' });
=back
It will return undef and sets an L<Module::Generic/error> if there is no L</filename> value set or if the file cannot be opened.
=head2 slurp_utf8
It returns the content of the file L</filename> utf-8 decoded.
This is equivalent to:
my $content = $uri->slurp({ binmode => ':utf8' });
C<:utf8> is slightly a bit more lax than C<:utf-8>, so it you want strict utf8, you can do:
my $content = $uri->slurp({ binmode => ':utf-8' });
=head1 AUTHOR
lib/Apache2/SSI/File.pm view on Meta::CPAN
=item C<binmode>
my $content = $uri->slurp({ binmode => ':utf-8' });
=back
It will return undef and sets an L<Module::Generic/error> if there is no L</filename> value set or if the file cannot be opened.
=head2 slurp_utf8
It returns the content of the file L</filename> utf-8 decoded.
This is equivalent to:
my $content = $uri->slurp({ binmode => ':utf8' });
C<:utf8> is slightly a bit more lax than C<:utf-8>, so it you want strict utf8, you can do:
my $content = $uri->slurp({ binmode => ':utf-8' });
=head1 AUTHOR
lib/Apache2/SSI/SharedMem.pm view on Meta::CPAN
}
else
{
return( $buffer );
}
}
if( @_ )
{
my $len = length( $_[0] );
# If the decoded data is not a reference of any sort, and the length parameter was provided
if( !ref( $data ) )
{
$_[0] = $size > 0 ? substr( $data, 0, $size ) : $data;
return( length( $_[0] ) || "0E0" );
}
else
{
$_[0] = $data;
return( $len || "0E0" );
}
lib/Apache2/SSI/URI.pm view on Meta::CPAN
=item C<binmode>
my $content = $uri->slurp({ binmode => ':utf-8' });
=back
It will return undef and sets an L<Module::Generic/error> if there is no L</filename> value set or if the file cannot be opened.
=head2 slurp_utf8
It returns the content of the file L</filename> utf-8 decoded.
This is equivalent to:
my $content = $uri->slurp({ binmode => ':utf8' });
C<:utf8> is slightly a bit more lax than C<:utf-8>, so it you want strict utf8, you can do:
my $content = $uri->slurp({ binmode => ':utf-8' });
=head1 AUTHOR
( run in 0.313 second using v1.01-cache-2.11-cpan-26ccb49234f )