given ($foo) {
when (/^abc/) { $abc = 1; }
when (/^def/) { $def = 1; }
when (/^xyz/) { $xyz = 1; }
default { $nothing = 1; }
}
a
for ($foo) {
if (/^abc/) { $abc = 1; }
elsif (/^def/) { $def = 1; }
elsif (/^xyz/) { $xyz = 1; }
else { $nothing = 1; }
}