def get_var(environ, keys, default=None):
    """Try each of the keys in turn before falling back on the default."""
    for key in keys:
        if environ.has_key(key):
            return environ.get(key)
    return default
