#!/usr/bin/perl -w use Error qw(:try); use MyErrors::SomeError; try { throw MyErrors::SomeError('throwing SomeError exception'); } catch MyErrors::SomeError with { my $err = shift; print "caught it: $err->{'-text'}\n"; };