Re: testing null strings for form field values

2001-06-05 Thread Michael Fowler
On Tue, Jun 05, 2001 at 02:09:30PM +0200, Marcelo E. Magallon wrote: > Perhaps also noteworthy is the fact that things like '$foo{bar} eq ""' > make the key 'bar' spring into existance in %foo. -w tells you about > it. The 'bar' key doesn't spring into existence, and -w doesn't tell you about

Re: testing null strings for form field values

2001-06-05 Thread Hasanuddin Tamir
On Tue, 5 Jun 2001, Marcelo E. Magallon <[EMAIL PROTECTED]> wrote, > Perhaps also noteworthy is the fact that things like '$foo{bar} eq ""' > make the key 'bar' spring into existance in %foo. -w tells you about > it. You mean $foo{bar}{baz} eq "". perl -wle 'my %foo; if ($foo{bar} eq "")

Re: testing null strings for form field values

2001-06-05 Thread Marcelo E. Magallon
>> Paul <[EMAIL PROTECTED]> writes: > > if ( $formdata{view_name} ne "" ) { > > $view = $formdata{view_name}; > > $viewtag = "1"; > > } > > For a simple boolean test, I usually find it more readable to be less > explicit in these cases: > > if ( $formdata{view_name} ) { > #

Re: testing null strings for form field values

2001-06-04 Thread M.W. Koskamp
- Original Message - From: Paul <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Perl Discuss <[EMAIL PROTECTED]> Sent: Monday, June 04, 2001 8:51 PM Subject: Re: testing null strings for form field values > > --- [EMAIL PROTECTED] wrote: > >

Re: testing null strings for form field values

2001-06-04 Thread Paul
--- [EMAIL PROTECTED] wrote: > if ( $formdata{view_name} ne "" ) { > $view = $formdata{view_name}; > $viewtag = "1"; > } For a simple boolean test, I usually find it more readable to be less explicit in these cases: if ( $formdata{view_name} ) { # etc. } = print "Just another

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

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