use Error qw(:try); use RemoteException; try { somefunction(1); } catch DeployException with { my $ex = shift; print "wibble\n"; } catch RemoteException with { my $ex = shift; print "dibble\n"; } catch WineException with { my $ex =shift; print "chinup\n"; }; sub somefunction { my $h =shift; throw WineException("hello world") if $h==1; return; }