I've also got some huge lists of variables to accept from a cgi program and I wondered if there were an easier way to do this too:if ($file1 ne "") { push @tour_photos, ($file1); } if ($file2 ne "") { push @tour_photos, ($file2); } if ($file3 ne "") { push @tour_photos, ($file3); } if ($file4 ne "") { push @tour_photos, ($file4); } if ($file5 ne "") { push @tour_photos, ($file5); } if ($file6 ne "") { push @tour_photos, ($file6); } if ($file7 ne "") { push @tour_photos, ($file7); } if ($file8 ne "") { push @tour_photos, ($file8); } if ($file9 ne "") { push @tour_photos, ($file9); } if ($file10 ne "") { push @tour_photos, ($file10); }
$address = $cgi->param('ADDRESS'); $bedrooms = $cgi->param('BEDROOMS'); $baths = $cgi->param('BATHS'); $garage = $cgi->param('GARAGE'); $roof = $cgi->param('ROOF'); $architectural_style = $cgi->param('ARCHITECTURAL_STYLE'); $floorplan = $cgi->param('FLOORPLAN'); $flooring = $cgi->param('FLOORING'); $heating = $cgi->param('HEATING'); $acreage = $cgi->param('ACREAGE'); $lot_dimensions = $cgi->param('LOT_DIMENSIONS'); $view = $cgi->param('VIEW'); $water_frontage = $cgi->param('WATER_FRONTAGE'); $short_description = $cgi->param('SHORT_DESCRIPTION'); $description = $cgi->param('DESCRIPTION'); $comments = $cgi->param('COMMENTS'); $area = $cgi->param('AREA'); $project = $cgi->param('PROJECT'); $zoning = $cgi->param('ZONING'); $taxes = $cgi->param('TAXES'); $tax_year = $cgi->param('TAX_YEAR'); $school_district = $cgi->param('SCHOOL_DISTRICT'); $schools = $cgi->param('SCHOOLS'); $mls = $cgi->param('MLS'); $price = $cgi->param('PRICE'); $downpayment = $cgi->param('DOWNPAYMENT'); $property_type = $cgi->param('PROPERTY_TYPE'); $thumbnail_photo = $cgi->param('THUMBNAIL_PHOTO'); $large_photo = $cgi->param('LARGE_PHOTO'); $tour_photos = $cgi->param('TOUR_PHOTOS'); $virtual_tour = $cgi->param('VIRTUAL_TOUR'); $virtual_tour_url = $cgi->param('VIRTUAL_TOUR_URL'); $flyer_url = $cgi->param('FLYER_URL'); $file1 = $cgi->param('file1'); $file2 = $cgi->param('file2'); $file3 = $cgi->param('file3'); $file4 = $cgi->param('file4'); $file5 = $cgi->param('file5'); $file6 = $cgi->param('file6'); $file7 = $cgi->param('file7'); $file8 = $cgi->param('file8'); $file9 = $cgi->param('file9'); $file10 = $cgi->param('file10');
In reply to Simplifying the following code by Stamp_Guy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |