use Carp::croak instead of die for better error reporting.

Fixes issue #10