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
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 "")
>> 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} ) {
> #
- 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:
> >
--- [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
[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
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