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
Back to
Seekers of Perl Wisdom