for my $exception (@exceptions) { if ($@ =~ /$exception->{error}/) { $exception->{action}( &LogMsg( \( "Error", "In action " . "$object_hash{name}: " . "$exception->{message}\n" ) ), "\n" ); } }