It is reported from Al-Awzâ’î – Allâh have mercy on him – that he said:

I have been told that it used to be said, “Woe to those who study [their religion] for a purpose other than worship, and those who seek to permit what is forbidden through doubts and specious arguments.”

Al-Khattîb Al-Baghdâdî, Iqtdâ Al-‘Ilm Al-‘Amal, p77.