Perhaps I'm not understanding the question, but what about something like:
my @tables = (200, 201);
for my $tab (@tables) {
print <<BLOCK;
ip rule add fwmark 0x0${tab}/0xffff table ${tab}
ip route add default via 172.27.${tab}.1 dev eth1.${tab} table ${tab}
BLOCK
}