Using Try::Tiny 

try {
    do_something();
}
catch {
    # exception is now in $_
};