The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<%INIT>
my @ids = ($User->id, @{$User->GetMergedUsers->Content});

my @conditions;
for my $type (@WatcherTypes) {
    for my $id (@ids) {
        push @conditions, "$type.id = $id";
    }
}

$$sql = "( ". join(" OR ", @conditions) . " )";

</%INIT>
<%ARGS>
@WatcherTypes => (qw(Watcher))
$User => undef
$sql => undef
</%ARGS>