Hook

fml 8 tutorial
Prev |  | Next

# Chapter 42. Hook

# Overview

Hooks are required to resolve complicated problems or for compilcated customization. But there are several problems in implemantation.

One problem is naming convension. $START_HOOK of fml4 is ambiguous. It means the location in process but not clarify where in which process. So, fml8 hook naming convension has role and function in it.

    $ROLE_FUNCTION_start_hook
    $ROLE_FUNCTION_end_hook

There is no common hook among processes. Each process has each hook. In other words, there is no common hook. You need to define plural hooks for different processes even if the hook is same content.

    $distribute_XXX_start_hook = q{ ... };
    $YYY_XXX_start_hook = $distribute_XXX_start_hook;

Coding style of hooks are expected not too restrictive since perl beginners may code it. fml8 modules have

    use strict;

definition but not effective in evalauating hooks. In evaluating a hook, fml8 evaluate it as

    no strict;
    HOOK CONTENT

to disable the strict check.

Function scope differs among fml4 and fml8. In fml4 all functions are global. Instead in fml8 functions are methods, which is not called anytime anywhere. We should provide hooks when we can see $curproc.

Prev | Home | Next
User Authentication | Up | Hook Naming Convension

fml 8.0 (fml-devel) project homepage is www.fml.org/software/fml8/.
fml 4.0 project homepage is www.fml.org/software/fml4/.
about one floppy bsd routers, see www.bsdrouter.org/.
other free softwares are found at www.fml.org/software/.

author's homepage is www.fml.org/home/fukachan/.
Also, visit nuinui's world :) at www.nuinui.net.

For questions about FML, e-mail <fml-bugs@fml.org>.