Sophie

Sophie

distrib > Momonga > 7 > x86_64 > media > updates > by-pkgid > 788f62f7d41064f588f856c66ee18a87

perl-Filter-Simple-0.84-4m.mo7.noarch.rpm

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.

Sources packages:

Other version of this rpm: