Thanks for the help!#!/usr/bin/perl use strict; use warnings; use CGI; use Data::Dumper; my $q = CGI->new(); print $q->header(); my $item = $q->param( 'item' ) || ''; my $change; # Get values if($item=~/test/) { $change = "blue"; }elsif($item=~/dark/){ $change = "black"; }elsif($item=~/white/){ $change = "light"; }elsif($item=~/house/){ $change = "home"; }elsif($item=~/all things/){ $change = "multi"; }elsif($item=~/money/){ $change = "value"; }elsif($item=~/country/){ $change = "USA"; }else{ $change = "neutral"; } print "Final Item = $change";
In reply to Improving if statements by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |