Personally, I don’t find the present way of doing it objectionable. Not at all. It’s obvious what it’s doing. However, you could put the keys into a hash and then loop through it ...
my %stuff = ( moo => "cow",
test => "blue",
dark => "black",
white => "light",
house => "home",
"all things" => "multi",
money => "value",
);
while (my ($k, $v) = each(%stuff)) {
if { $input =~ /$k/ } {
change = $v;
last; # break out of the loop now
}
But is it “improved?” I probably wouldn’t think so, really, because an if..elsif..else cascade is both extremely readable and easy to change, and you can put the most-common cases right up at the top. Basically, unless you have a compelling reason other than vague thoughts of “efficiency” to change the code as it is now, I’d move on to the next to-do ticket.