Help for this page

Select Code to Download


  1. or download this
    sub DoTask1 {
       my ($object, @arguments) = @_;
    ...
       }
       return $object->CommonTask(@arguments);
    }
    
  2. or download this
    sub Helper {
       my ($object, $defaults, @arguments) = @_;
    ...
       }
       return $object->Helper([ qw(ARG3 ARG5 ARG7) ], @arguments);
    }
    
  3. or download this
    sub Helper {
       my ($object, $code, $defaults, @arguments) = @_;
    ...
                                  $object->DoSomeMoreSetup();
                               }, [ qw(ARG3 ARG5 ARG7) ], @arguments);
    }
    
  4. or download this
    my $original_state = Module::GetServiceState();
    Module::SetServiceState(0); # temporarily disable the service, if it's
    + not already
    ...
    $object->DoSomethingElse();
    
    Module::SetStatus($original_state); # restore it to what it was before
    
  5. or download this
    sub TempDisableService {
       my $code = shift;
    ...
       $object->DoSomethingAlso();
    };
    
  6. or download this
    TempDisableService {
       $object->DoSomething();
       $object->DoSomethingElse();
    };