ASP
view release on metacpan or search on metacpan
$Application $ObjectContext $Request
$Response $Server $Session
$ScriptingNamespace
)],
all => [qw(
Print Warn die exit param param_count
$Application $ObjectContext $Request
$Response $Server $Session
$ScriptingNamespace
DebugPrint HTMLPrint
escape unescape escapeHTML unescapeHTML
)],
);
Exporter::export_tags('basic');
Exporter::export_ok_tags('all');
$Application = $main::Application;
$ObjectContext = $main::ObjectContext;
$Request = $main::Request;
$Response = $main::Response;
$Server = $main::Server;
Exits the current script. $Response->End is called automatically for you.
Any cleanup code added with C<AddDeathHook> is also called.
=cut
sub exit {
_END;
$main::Response->End();
CORE::exit();
}
=head2 escape LIST
Escapes (URL-encodes) a list. Uses ASP object method
$Server->URLEncode().
=cut
sub escape { map { $main::Server->URLEncode($_) } @_; }
=head2 unescape LIST
Unescapes a URL-encoded list. Algorithms ripped from CGI.pm
method of the same name.
=cut
sub unescape {
map {
tr/+/ /;
s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
} @_;
}
=head2 escapeHTML LIST
Escapes a list of HTML. Uses ASP object method $Server->HTMLEncode().
If passed an array reference, escapeHTML will return a reference
to the escaped array.
=cut
sub escapeHTML {
my ($flag, @args) = (0, @_);
@args = @{$args[0]} and $flag++ if ref $args[0] eq "ARRAY";
$_ = $main::Server->HTMLEncode($_) for @args;
$flag ? \@args : @args;
}
=head2 unescapeHTML LIST
Unescapes an HTML-encoded list.
If passed an array reference, unescapeHTML will return a reference
to the un-escaped array.
=cut
sub unescapeHTML {
my ($flag, @args) = (0, @_);
@args = @{$args[0]} and $flag++ if ref $args[0] eq "ARRAY";
map {
s/&/&/gi;
s/"/"/gi;
s/ / /gi;
s/>/>/gi;
s/</</gi;
s/&#(\d+);/chr($1)/ge;
s/&#x([0-9a-f]+);/chr(hex($1))/gi;
under Apache::ASP.
Was forced to clear @DeathHooks array after calling _END() because
of the persistent state of Apache::ASP holding over contents across
executions.
Removed BinaryWrite(), SetCookie(), and Autoload functionality.
=item Version 1.00
The escapeHTML() and unescapeHTML() functions now accept array refs as well
as lists, as Win32::ASP::HTMLEncode() was supposed to.
Thanks to Matt Sergeant for the fix.
=item Version 0.97
Optimized and debugged.
=item Version 0.77
Overloaded warn() and subsequently removed prototypes.
Exported $ScriptingNamespace object.
Added methods escape(), unescape(), escapeHTML(), unescapeHTML().
Thanks to Bill Odom for pointing these out!
Re-implemented SetCookie and BinaryWrite functions.
=item Version 0.11
Optimized and debugged.
=back
Prints the contents of LIST to the browser and then exits. die
automatically calls $Response->End for you, it also executes any
cleanup code you have added with `AddDeathHook'.
exit
Exits the current script. $Response->End is called automatically
for you. Any cleanup code added with `AddDeathHook' is also
called.
escape LIST
Escapes (URL-encodes) a list. Uses ASP object method $Server-
>URLEncode().
unescape LIST
Unescapes a URL-encoded list. Algorithms ripped from CGI.pm
method of the same name.
escapeHTML LIST
Escapes a list of HTML. Uses ASP object method $Server-
>HTMLEncode().
If passed an array reference, escapeHTML will return a reference
to the escaped array.
unescapeHTML LIST
Unescapes an HTML-encoded list.
If passed an array reference, unescapeHTML will return a
reference to the un-escaped array.
param EXPR [, EXPR]
Simplifies parameter access and makes switch from GET to POST
transparent.
Given the following querystring:
myscript.asp?x=a&x=b&y=c
work under Apache::ASP.
Was forced to clear @DeathHooks array after calling _END()
because of the persistent state of Apache::ASP holding over
contents across executions.
Removed BinaryWrite(), SetCookie(), and Autoload
functionality.
Version 1.00
The escapeHTML() and unescapeHTML() functions now accept
array refs as well as lists, as Win32::ASP::HTMLEncode() was
supposed to. Thanks to Matt Sergeant for the fix.
Version 0.97
Optimized and debugged.
Version 0.77
Overloaded warn() and subsequently removed prototypes.
Exported $ScriptingNamespace object.
Added methods escape(), unescape(), escapeHTML(),
unescapeHTML(). Thanks to Bill Odom for pointing these out!
Re-implemented SetCookie and BinaryWrite functions.
Version 0.11
Optimized and debugged.
SEE ALSO
ASP::NextLink(3)
( run in 0.296 second using v1.01-cache-2.11-cpan-c21f80fb71c )