Running ActiveState Perl 5.10.1 on win32.
How is it that this code:
die(defined($r->unparsed_uri =~ '/(logout.pl)?$'));
...dies with 1, whereas changing the same line to say this:
die($r->unparsed_uri =~ '/(logout.pl)?$');
...dies with Use of uninitialized value in die?
How is it defined yet uninitialized? I thought uninitialized meant undefined.
In the first case, the matching operation is taking place in scalar context. In the second case, it's taking place in array context, almost as if you had written:
If
$r->unparsed_urimatches the pattern, but$1is undefined because the matched string ended with "/", then @groups will be an array of length 1, containing the single elementundef.Put it all together, it's as if you'd said: