def served_by_perl(url):
 r = requests.get(url, allow_redirects=False)
 status = (r.status_code == 302)
 perl = (('x-perl-redirect' in r.headers) and (r.headers['x-perl-redirect'] == 'True'))
 return all([status, perl])

def served_by_perl ( url ) : r = requests . get ( url , allow_redirects = False ) status = ( r . status_code == 302 ) perl = ( ( 'x-perl-redirect' in r . headers ) and ( r . headers [ 'x-perl-redirect' ] == 'True' ) ) return all ( [ status , perl ] )
return true if url returns 200 and is served by perl .