C doesn't clean up much* by it self and when you need to do your own clean up handling you use end handers, which are not exactly signal handlers, just like perl. See the atexit() function in stdlib.
* besides closing the file handles and freeing the memory, which are done by the kernel regardless of language.