Letter P

perl-Filter-Simple - Simplified source filtering

Website: http://www.perl.org/
License: GPL+ or Artistic
Description:
Source filtering is an immensely powerful feature of recent versions of Perl.
It allows one to extend the language itself (e.g. the Switch module),
to simplify the language (e.g. Language::Pythonesque), or to completely
recast the language (e.g. Lingua::Romana::Perligata). Effectively, it allows
one to use the full power of Perl as its own, recursively applied, macro language.

The excellent Filter::Util::Call module (by Paul Marquess) provides a usable
Perl interface to source filtering, but it is often too powerful and not nearly
as simple as it could be.

To use the module it is necessary to do the following:

   1. Download, build, and install the Filter::Util::Call module. (If you have Perl 5.7.1 or later, this is already done for you.)
   2. Set up a module that does a use Filter::Util::Call.
   3. Within that module, create an import subroutine.
   4. Within the import subroutine do a call to filter_add, passing it either a subroutine reference.
   5. Within the subroutine reference, call filter_read or filter_read_exact to "prime" $_ with source code data from the source file that will use your module. Check the status value returned to see if any source code was actually read in.
   6. Process the contents of $_ to change the source code in the desired manner.
   7. Return the status value.
   8. If the act of unimporting your module (via a no) should cause source code filtering to cease, create an unimport subroutine, and have it call filter_del. Make sure that the call to filter_read or filter_read_exact in step 5 will not accidentally read past the no. Effectively this limits source code filters to line-by-line operation, unless the import subroutine does some fancy pre-pre-parsing of the source code it's filtering.

Packages

perl-Filter-Simple-0.91-5m.mo8.noarch [41 KiB] Changelog by Yohsuke Ooi (2016-08-05):
- (20:5.20.0-5m)
- add gcc5 patches

Listing created by Repoview-0.6.6-1m.mo8