SilverB1rd has asked for the wisdom of the Perl Monks concerning the following question:
Ok I would like to make my "if" look better.
I'm getting data from a web form using CGI.
The data I'm checking is the Ship-to address, they don't have to fill in these fields but if they do that have to fill in the required ones.
I have come up with this so far.
if ( ( $query->param("Shipping_address") || $query->param("shipCity") || $query->param("shipState") || $query->param("shipcountry") || $query->param("shipZip") || $query->param("shipdayph") ) && ( !$query->param("Shipping_address") || !$query->param("shipCity") || !$query->param("shipState") || !$query->param("shipcountry") || !$query->param("shipZip") || !$query->param("shipdayph") ) ) { failure(); }
------
PT - Perl Tanks %100 Perl programming game
The Price of Freedom is Eternal Vigilance
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Nicer If...
by suaveant (Parson) on Jul 12, 2001 at 23:09 UTC | |
by Biker (Priest) on Jul 13, 2001 at 16:53 UTC | |
by suaveant (Parson) on Jul 13, 2001 at 17:28 UTC | |
Re: Nicer If...
by runrig (Abbot) on Jul 12, 2001 at 23:12 UTC | |
by suaveant (Parson) on Jul 12, 2001 at 23:16 UTC | |
by suaveant (Parson) on Jul 12, 2001 at 23:18 UTC |
Back to
Seekers of Perl Wisdom