Hook::Filter 0.02
Sponsored Links
Hook::Filter 0.02 Ranking & Summary
File size:
0.015 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1099
Date added:
2006-10-20
Publisher:
Erwan Lemonnier
Hook::Filter 0.02 description
Hook::Filter is a runtime filtering layer on top of subroutine calls.
SYNOPSIS
Imagine you have a big program using a logging library that exports 3 functions called mydebug, myinfo and mywarn. Those functions generate far too much log, so you want to skip calling them except in some specific circumstances.
In your main program, write:
use Hook::Filter hook => ["mydebug","myinfo","mywarn"];
In all modules making use of the logging library, write:
use Hook::Filter;
Then create a file called ./hook_filter.rules. This file contains boolean expressions that specify when calls to the filtered subroutines should be allowed:
# allow calls to mydebug only inside package My::Filthy:Attempt
is_sub(mydebug) && from_pkg(My::Filthy::Attempt)
# allow all calls to myinfo except from inside packages under the namespace My::Test::
is_sub(myinfo) && !from_pkg(/^My::Test/)
# allow calls to mywarn from function do_stuff in package main
# whose third argument is a message that does not match the string invalid login name
is_sub(mywarn) && from_sub(do_stuff) && from_pkg(main) && !has_arg(3,/invalid login name/)
# all other calls to myinfo, mydebug or mywarn will be skipped
SYNOPSIS, Log::Dispatch
Your program uses Log::Dispatch. You want to enable Hook::Filter on top of the methods log and log_to from Log::Dispatch everywhere at once. And you want to use the filter rules located in /etc/myconf/filter_rules.conf. Easy: in main, write:
use Hook::Filter rules => /etc/myconf/filter_rules.conf, hook => [Log::Dispatch::log,Log::Dispatch::log_to];
SYNOPSIS
Imagine you have a big program using a logging library that exports 3 functions called mydebug, myinfo and mywarn. Those functions generate far too much log, so you want to skip calling them except in some specific circumstances.
In your main program, write:
use Hook::Filter hook => ["mydebug","myinfo","mywarn"];
In all modules making use of the logging library, write:
use Hook::Filter;
Then create a file called ./hook_filter.rules. This file contains boolean expressions that specify when calls to the filtered subroutines should be allowed:
# allow calls to mydebug only inside package My::Filthy:Attempt
is_sub(mydebug) && from_pkg(My::Filthy::Attempt)
# allow all calls to myinfo except from inside packages under the namespace My::Test::
is_sub(myinfo) && !from_pkg(/^My::Test/)
# allow calls to mywarn from function do_stuff in package main
# whose third argument is a message that does not match the string invalid login name
is_sub(mywarn) && from_sub(do_stuff) && from_pkg(main) && !has_arg(3,/invalid login name/)
# all other calls to myinfo, mydebug or mywarn will be skipped
SYNOPSIS, Log::Dispatch
Your program uses Log::Dispatch. You want to enable Hook::Filter on top of the methods log and log_to from Log::Dispatch everywhere at once. And you want to use the filter rules located in /etc/myconf/filter_rules.conf. Easy: in main, write:
use Hook::Filter rules => /etc/myconf/filter_rules.conf, hook => [Log::Dispatch::log,Log::Dispatch::log_to];
Hook::Filter 0.02 Screenshot
Hook::Filter 0.02 Keywords
Filter 0.02
subroutine calls
calls
MyInfo
top
&&
subroutine
runtime
Hook::Filter
HookFilter
Hook::Filter 0.02
Libraries
Programming
Bookmark Hook::Filter 0.02
Hook::Filter 0.02 Copyright
WareSeeker periodically updates pricing and software information of Hook::Filter 0.02 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Hook::Filter 0.02 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Sax Filter is a modular set of filters that can be used to process XML documents via Javas SAX support. Free Download
GDBM_File package allows Perl5 access to the gdbm library. Free Download
HTML::Detoxifier is a practical module to strip harmful HTML. Free Download
Apache2::DebugFilter is a Perl module to debug mod_perl and native Apache2 filters. Free Download
XML::Filter::Mode Perl module can filter out all chunks not in the current mode. Free Download
Hook::Scope is a Perl extension for adding hooks for exiting a scope. Free Download
HCKit::Template is a Perl module with a template system for HTML construction. Free Download
mooseekd is a partial fork of Museek+, containing only the standalone daemon needed to connect to the Soulseek P2P network. Free Download
Latest Software
Popular Software
Favourite Software