SYNOPSIS

  use OpaL::action qw(functionnames);

No functions or variables are exported automaticly so you have to specify them here.

DESCRIPTION

OpaL::action is a module to allow some better bugtracking and information to be sent to the user/developer.

All functions are autoloaded so they will not be loaded into memory if you have not used them before.

There are 5 different levels of the information/action.

1.

critical

2.

error

3.

warning

4.

message

5.

debug

FUNCTIONS

setQuitLevel

You can set on what errorlevel the program should exit if an error occur. The default level is 2 and you canges it like this: \s-1USAGE:\s0

    \*(C`setQuitLevel\*(C'(level);
setErrorHandler

You can set an alternative error handler function (no arguments). The default one is exit. \s-1USAGE:\s0

    \*(C`setErrorHandler\*(C'(\funcname);
setDebugLevel

You can set on what errorlevel the program should output messages if an error occur. The debug level indicates what type of information that should be presented to the user. \s-1USAGE:\s0

    \*(C`setDebugLevel\*(C'(level);
getQuitLevel

You can set on what errorlevel the program should exit if an error occur. \s-1USAGE:\s0

    $foo = \*(C`getQuitLevel\*(C';
getDebugLevel

You can get the debuglevel on which the program should output messages, if an error occurs. \s-1USAGE:\s0

    $foo = \*(C`getDebugLevel\*(C';
pdebug

You can set on what errorlevel the program should exit if an error occur. With the pdebug method you can present information and mark it with a debuglevel using: \s-1USAGE:\s0

    \*(C`pdebug\*(C'(level, \*(L"A sample informational text.\*(R" [,funcref]);
action

With this function you can handle and print a message if a function does not work correctly. It will exit the program and print a message with the error level before if the action returns true and if the action_critic is lower or equal to the set error level. If the debug level is high enough it will present the message but without the trailing error message. \s-1USAGE:\s0

    \*(C`action\*(C'(some_action,
           \*(L"A sample informational text about the action.\*(R",
            how_critical [,funcref]);

The last parameter (how_critical) is optional.

cmdaction

Actually the same as action with the difference that it executes a external command instead. It is almost identical to action(system\*(L"a command to execute\*(R", ...); \s-1USAGE:\s0

    \*(C`cmdaction\*(C'(\*(L"a command to execute.\*(R",
              \*(L"A sample informational text about the action.\*(R",
               how_critical,

how_quiet [,funcref]); The two last parameter (how_critical) is optional. The last parameter tells how quiet the executing command should be:

  0 - extremely quiet (ie: >& /dev/null)
  1 - quiet           (ie: >& /dev/null)
  2 - everything sent to stdout.

=back

AUTHOR

Ola Lundqvist <[email protected]>

RELATED TO OpaL::action…

perl\|(1).

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 415:

You forgot a '=back' before '=head1'