You can hate perl all you like
But it has block scope and a binding construct ('my') which is distinct from assignment. Python, the language we are all meant to love has neither of these. So it has 'global' which doesn't fix the problem and now 'nonlocal' which does fix part of it. Except if your language needs scope-resolution constructs then its claims to be lexically scoped are just bullshit.
Perl was designed by someone who had questionable taste and knew it. Python was designed by someone who doesn't know what taste is.