Structured exceptions 

sub throw {
  my($msg) = @_;
  my($package, $file, $line) = caller(0);
  die {file => $file, line => $line, message => $msg};
}

eval {
  throw('invalid argument');
};
if($@) {
  die "$@->{message} at $@->{file} line $@->{line}.\n";
}