On 06/26/2014 08:42 PM, Mark Hedges wrote:
Try in a handler. (Apparently you cannot use Apache2::URI from command line?)
use Apache2::Log ();
use Apache2::URI ();
sub handler {
my ($r) = @_;
my $string = "6%2D41913%2FUK1";
Apache2::URI::unescape($string);
$r->log_error($stri
Try in a handler. (Apparently you cannot use Apache2::URI from command line?)
use Apache2::Log ();
use Apache2::URI ();
sub handler {
my ($r) = @_;
my $string = "6%2D41913%2FUK1";
Apache2::URI::unescape($string);
$r->log_error($string);
}
Log contains: 6-41913/UK1\0UK1
??
-Mark
There is also something to be said for writing clear and obvious code, even if it does
cost a couple of CPU cycles of which there are about 2.5 billion available every second.
I prefer this version :
my $args = $r->args;
if (defined($args) && ($args eq 'last')) {
...
}
unless $args is used exc
Nope Joshua you're right, I missed that.
defined() is faster than the logical check because the logical check checks
defined, then checks if empty string, then checks if numerically 0, except if
it is 0E0 (zero but true). One operation versus the same operation plus three
more; the one by itse
On Thu, Jun 26, 2014 at 03:52:33AM -0400, Joshua Narins wrote:
> On Mon, Jun 23, 2014 at 06:21:37PM +, Mark Hedges wrote:
> > Perl 5.20.0, Apache 2.2.27, APR 1.5.1, APR-util 1.5.3, mod_perl trunk.
> >
> > 2014-06-23 11:16:32 Mon $ svn diff t/lib/Apache2/TestReload.pm
> > Index: t/lib/Apache2/
Hello,
another question:
why not just
my $args = $r->args;
if ( $args and $args eq 'last' ) {
(without defined)
or even
if ( my $args = $r->args and $args eq 'last' ) {
:)
2014-06-26 10:52 GMT+03:00 Joshua Narins :
> On Mon, Jun 23, 2014 at 06:21:37PM +, Mark Hedges wrote:
> > Perl 5
On Mon, Jun 23, 2014 at 06:21:37PM +, Mark Hedges wrote:
> Perl 5.20.0, Apache 2.2.27, APR 1.5.1, APR-util 1.5.3, mod_perl trunk.
>
> 2014-06-23 11:16:32 Mon $ svn diff t/lib/Apache2/TestReload.pm
> Index: t/lib/Apache2/TestReload.pm
> =