I used to catch a ton of caterpillars and store them in empty yogurt jars with holes in the lid and kept them there until they died, usually a week or so later. Then I'd get more. God I loved caterpillars. My dad used to spray their nests they built in the trees out back and I'd get SO upset at him.
That's about as close as I got to having a pet mealworm.
When I got a little older, I started releasing them after a day or so, so they wouldn't die. I'd just keep them for the afternoon to play with them. (I'd have them walk on my arms, or around the rim of the yogurt container)