RE: testing null strings for form field values

2001-06-04 Thread Savin, Jill
*** -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 04, 2001 2:30 PM To: Hasanuddin Tamir Cc: [EMAIL PROTECTED] Subject: Re: testing null strings for form field values honestly, i havent even covered use::strict in my

Re: testing null strings for form field values

2001-06-04 Thread David Labatte
Randal is of course right. I apologize for my extremely confusing and idiom riddled post. "Randal L. Schwartz" wrote: > > "David" == David Labatte <[EMAIL PROTECTED]> writes: > > David> The why though is most likely that: undef ne '' > > That's not true. undef eq ''. > Sorry I meant that

Re: testing null strings for form field values

2001-06-04 Thread Hasanuddin Tamir
On Tue, 5 Jun 2001, Hasanuddin Tamir <[EMAIL PROTECTED]> wrote, > Date: Tue, 5 Jun 2001 01:22:59 +0700 (JAVT) > Take a look at these one-liner examples. The string "(nothing)" indicates > that no output is printed. > > 1% perl -le '$x; print 1 if $x ne ""' > (nothing) > > 2% perl -le '$x = und

Re: testing null strings for form field values

2001-06-04 Thread charles
honestly, i havent even covered use::strict in my readings yet. i am brand spanking new to the language, however i am indeed running perl with -w. -cjm On Tue, 5 Jun 2001, Hasanuddin Tamir wrote: > On Mon, 4 Jun 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote, > > > if ( $formdata{view_name

Re: testing null strings for form field values

2001-06-04 Thread Hasanuddin Tamir
On Mon, 4 Jun 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote, > if ( $formdata{view_name} ne "" ) { > $view = $formdata{view_name}; > $viewtag = "1"; > } > > is there a special method for testing against a null string for a form > field's value? i am using the above data, but it seems to a

Re: testing null strings for form field values

2001-06-04 Thread Randal L. Schwartz
> "David" == David Labatte <[EMAIL PROTECTED]> writes: David> The why though is most likely that: undef ne '' That's not true. undef eq ''. David> What I usually do if I have code that expects an empty string David> instead of an undef is append an empty string onto it when I read David> t

Re: testing null strings for form field values

2001-06-04 Thread David Labatte
Yes, that very well might return 1. If you are getting the form variable data from cgi.pm then a blank form field will appear as an undefined value in perl, not an empty string. So the previous posters response about testing for the true'ness of the form value will work always and is how I usu

Re: testing null strings for form field values

2001-06-04 Thread Mathew Hennessy
[EMAIL PROTECTED] wrote: > > if ( $formdata{view_name} ne "" ) { > $view = $formdata{view_name}; > $viewtag = "1"; > } > > is there a special method for testing against a null string for a form > field's value? i am using the above data, but it seems to always return exists() will t

Re: testing null strings for form field values

2001-06-04 Thread Brett W. McCoy
On Mon, 4 Jun 2001 [EMAIL PROTECTED] wrote: > if ( $formdata{view_name} ne "" ) { > $view = $formdata{view_name}; > $viewtag = "1"; > } > > is there a special method for testing against a null string for a form > field's value? i am using the above data, but it seems to always return > with a

testing null strings for form field values

2001-06-04 Thread charles
if ( $formdata{view_name} ne "" ) { $view = $formdata{view_name}; $viewtag = "1"; } is there a special method for testing against a null string for a form field's value? i am using the above data, but it seems to always return with a value of "1" making me think that something is incorrect in