for ($query->{'action'}) { $allowed = /post/ ? { ... } : /edit/ ? { ... } : /delete/ ? { ... } : die "that action isn't supported"; }