RE: empty versus zero

2003-08-14 Thread Michael D. Smith
if (! defined ($value)) { print 1 value not defined\n;} if ($value eq ) { print 2 Found empty string ($value)\n; } if ($value == 0) { print 3 Found a zero too ($value)\n; } $value = ''; if (defined ($value)) { print 4 value now is defined but null ($value)\n;} if ($value eq ) { print 5 Found

Re: empty versus zero

2003-08-14 Thread C. Church
How can I count empty values in an array? This count should not include zeros or non-empty values. Below is my current script, but it isn't working properly. map { $count++ if(!length($_)) } @expression; ... will count zero-length elements. !c === Discreet

RE: empty versus zero

2003-08-14 Thread Lynn. Rickards
I think this is a fairly simple question... How can I count empty values in an array? This count should not include zeros or non-empty values. Below is my current script, but it isn't working properly. I appreciate any assitance that you may provide. Thank you, David #!perl -w #

Re: empty versus zero

2003-08-14 Thread Will of Thornhenge
To: [EMAIL PROTECTED] Cc: 'David Byrne' Subject: Re: empty versus zero I prefer Lynn. Rickards' method to the others I've seen mentioned. Testing whether the value is defined will always work quietly and swiftly; several of the other tests proposed will generate warnings under some conditions

RE: empty versus zero

2003-08-14 Thread Xu, Qiang (XSSC SGP)
Lynn. Rickards wrote: Thanks Will but I'll own up to maybe not reading the spec closely enough. Is the string to be considered empty? It passes defined() nevertheless...as does the empty string ''. Embarrassing. I think the string is not empty. It is just initialized to a string containing

RE: empty versus zero

2003-08-14 Thread Lynn. Rickards
Of Will of Thornhenge Sent: Wednesday, August 13, 2003 8:36 PM To: [EMAIL PROTECTED] Cc: 'David Byrne' Subject: Re: empty versus zero I prefer Lynn. Rickards' method to the others I've seen mentioned. Testing whether the value is defined will always work quietly and swiftly; several of the other tests