Ah yes, brings back memories. This was the Star Trek episode named “The Apple”. The natives fed the reptile head named “Vaal” and he took care of them.