Exception handling 

eval { do_something() };
if($@) {
    cleanup();
    die "Failed in do_something: $@";
}