J�rg,

        Your solution, if (defined <param:foo/>) does work. I checked it 
immediately as I noticed your post in the mailing list. I was ready to 
write mea culpa response but decided to save list from one post with 
litle (if any) new information.

        As for my statement. It was attempt of not native english speaker to 
say what perl v5.6.1 documentation author in 'perldoc -f defined' stated 
as "<...>(A simple Boolean test will not
                distinguish among "undef", zero, the empty string,
                and "0", which are all equally false.)<...>"
Add inertia of thinking (Nigel used param tag in boolean context), 
belief that logic of common task should be moved into taglibs (and work 
with parameters seams common task for me) and you'll see why my message 
was what it was. :-)


J�rg Walter wrote:
> On Wednesday 24 July 2002 19:48, Aidas Kasparas wrote:
> 
> 
>>You can not directly. Empty string and undef are identical for perl.
> 
> 
> sorry, but this is wrong. "" is not the same as undef. The following 
> expressions are true:
> 
> my $empty = ""; my $undef;
> 
> $empty eq $undef (but issues a warning if -w is used)
> $empty == $undef (dito)
> defined $empty
> 
> But these return false:
> 
> defined $undef
> $undef
> $empty
> 
> (see also perldoc -f defined, perldoc -f exists)
> 
> 
>>You could use following perl code:
>>
>>if (exists ${$cgi->param}{foo}) { ....
> 
> 
> A 'defined' test would suffice. But 'exists' is fine, too, of course. "defined 
> <param:foo/>" could or could not work, depending on how the param taglib is 
> written. (it should work, I believe)
> 
> CU
> J�rg



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to