It sounds like you may have found a worm of some sort in the Pupae stage or Chrysalis stage. During that stage they will develop a harder outer shell that is segmented and go through the metamorphosis until it emerges as a beetle, moth or Butterfly.
This will give you an idea of what a super worm pupae looks like:
I am sure the one you may have found was bigger, but it does sound like a Pupae or Chrysalis of a beetle, moth, or butterfly. Joan