Tons of foods, you usually need a hugely rounded diet to keep them alive without for any length of time though and they usually start to die within a week or so.
Temperature has a big role in the hornworms. Lower the temperature the slower they grow when you're at about 80 they grow really fast. If you keep them at 50 it'll stop their growth