Added most of the perl functionality.