malaga has asked for the wisdom of the Perl Monks concerning the following question:
and thisif ((-e $info) and ($query =~ /support/)) { open (FILE, $info) or die "Can't open file!"; print while <FILE>; close FILE; } if ((-e $info) and ($query ne /support/)) { print "<a href\=\"$webdir/cgi-bin/getprods.pl?$prodlisting\">"; print "Product Listing</a><br><br>"; open (FILE, $info) or die "Can't open file!"; print while <FILE>; close FILE; }
And, another problem:if (-e $info) { if ((-e $info) and ($query =~ /support/)) { open (FILE, $info) or die "Can't open file!"; print while <FILE>; close FILE; } if ((-e $info) and ($query ne /support/)) { print "<a href\=\"$webdir/cgi-bin/getprods.pl?$prodlisting\">"; print "Product Listing</a><br><br>"; open (FILE, $info) or die "Can't open file!"; print while <FILE>; close FILE; } }
it returns true no matter what (with ne)if ((-e $info) and ($query ne /support/))
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: if statement/uninitialized value
by broquaint (Abbot) on May 28, 2002 at 14:00 UTC | |
|
Re: if statement/uninitialized value
by Joost (Canon) on May 28, 2002 at 14:03 UTC | |
|
Re: if statement/uninitialized value
by ides (Deacon) on May 28, 2002 at 13:57 UTC | |
|
Re: if statement/uninitialized value
by malaga (Pilgrim) on May 28, 2002 at 14:09 UTC | |
by chromatic (Archbishop) on May 28, 2002 at 14:36 UTC | |
by broquaint (Abbot) on May 28, 2002 at 14:46 UTC | |
|
Re: if statement/uninitialized value
by Aristotle (Chancellor) on May 28, 2002 at 16:29 UTC | |
|
Re: if statement/uninitialized value
by malaga (Pilgrim) on May 28, 2002 at 19:09 UTC |