11 October 2008
This post may be outdated due to it was written on 2008. The links may be broken. The code may be not working anymore. Leave comments if needed.
augment can be used as trigger in sub, to let user do something he wants.

for example, I want to let user custom $message before insert into $file in IRC::Bot::Log::Extended.
so that he can skip some lines or URI::Find some URLs.

full code are:
http://fayland.googlecode.com/svn/trunk/CPAN/IRC-Bot-Log-Extended/examples/02b_with_filter.pl
http://fayland.googlecode.com/svn/trunk/CPAN/IRC-Bot-Log-Extended/examples/03advanced.pl

I also write a simple test script:
http://fayland.googlecode.com/svn/trunk/script/learn_moose/008_augment.pl

hmm, that's simple. just think about u defined a virtual sub in parent pm, then user can override it in child pm.
nothing special.

Thanks.


blog comments powered by Disqus