Filter::Util::Call

Filter::Util::Call is a Perl Source Filter Utility Module.
Download

Filter::Util::Call Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Paul Marquess
  • Publisher web site:
  • http://search.cpan.org/~pmqs/IO-Compress-Bzip2-2.012/lib/IO/Compress/Bzip2.pm

Filter::Util::Call Tags


Filter::Util::Call Description

Filter::Util::Call is a Perl Source Filter Utility Module. Filter::Util::Call is a Perl Source Filter Utility Module.SYNOPSIS use Filter::Util::Call ;This module provides you with the framework to write Source Filters in Perl.An alternate interface to Filter::Util::Call is now available. See Filter::Simple for more details.A Perl Source Filter is implemented as a Perl module. The structure of the module can take one of two broadly similar formats. To distinguish between them, the first will be referred to as method filter and the second as closure filter.Here is a skeleton for the method filter: package MyFilter ; use Filter::Util::Call ; sub import { my($type, @arguments) = @_ ; filter_add([]) ; } sub filter { my($self) = @_ ; my($status) ; $status = filter_read() ; $status ; } 1 ;and this is the equivalent skeleton for the closure filter: package MyFilter ; use Filter::Util::Call ; sub import { my($type, @arguments) = @_ ; filter_add( sub { my($status) ; $status = filter_read() ; $status ; } ) } 1 ;To make use of either of the two filter modules above, place the line below in a Perl source file. use MyFilter; In fact, the skeleton modules shown above are fully functional Source Filters, albeit fairly useless ones. All they does is filter the source stream without modifying it at all.As you can see both modules have a broadly similar structure. They both make use of the Filter::Util::Call module and both have an import method. The difference between them is that the method filter requires a filter method, whereas the closure filter gets the equivalent of a filter method with the anonymous sub passed to filter_add.To make proper use of the closure filter shown above you need to have a good understanding of the concept of a closure. See perlref for more details on the mechanics of closures. Requirements: · Perl


Filter::Util::Call Related Software