undefined - Can a value be uninitialized, but still defined, in Perl? -
Running ActiveState Perl 5.10.1 on Win32.
How is this code:
dead (defined ($ r->; unparsed_uri = ~ '/ (logout.pl.)' $ ')); Dies with
... 1
, while changing the same line to say:
die ( $ R-> gt; Unparsed_uri = ~ '/ (logout.pl)? $'); Use undefined value in
... dies
<<> defined
so far Initialize
? I thought undefined means undefined.
In the first case, the matching operation is taking place in the scalar In the second case, this array is in context Almost as you wrote:
my @ group = $ r-> gt; Unparsed_uri = ~ '/ (logout.pl))'; Die @ group;
If the $ r-> unparsed_uri
corresponds to the pattern, but $ 1
is undefined because the matching string with "/" Finished, then the @ group will be an array of length 1, in which an element will be undef
.
Put it together, it seems as if you want to:
die (undef);
Comments
Post a Comment