package FaxIt::Client; sub new { if (...[service is running]...) { if (...[service is non-responsive]...) { ...[restart the service]... } } else { ...[start the service]... } } sub send { ... ...[send request to the service]... ... }