X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfilter.pod;h=c3c83153adfaf643b415846f00cf8f529ad23bd2;hb=1f950eb4f39b89f547d5802df0c94526d900d2f2;hp=f3ab788ffc1376fcdec40096391e9d7e2f5797f1;hpb=c7c04614297eaf861353db8b10652f71378803e4;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfilter.pod b/pod/perlfilter.pod index f3ab788..c3c8315 100644 --- a/pod/perlfilter.pod +++ b/pod/perlfilter.pod @@ -1,7 +1,7 @@ =head1 NAME perlfilter - Source Filters - + =head1 DESCRIPTION @@ -19,12 +19,10 @@ you'll soon learn. But first, the basics. =head1 CONCEPTS Before the Perl interpreter can execute a Perl script, it must first -read it from a file into memory for parsing and compilation. (Even -scripts specified on the command line with the C<-e> option are stored in -a temporary file for the parser to process.) If that script itself -includes other scripts with a C or C statement, then each -of those scripts will have to be read from their respective files as -well. +read it from a file into memory for parsing and compilation. If that +script itself includes other scripts with a C or C +statement, then each of those scripts will have to be read from their +respective files as well. Now think of each logical connection between the Perl parser and an individual file as a I. A source stream is created when @@ -57,7 +55,7 @@ Every source stream is associated with only one file. A source filter is a special kind of Perl module that intercepts and modifies a source stream before it reaches the parser. A source filter -changes the our diagram like this: +changes our diagram like this: file ----> filter ----> parser @@ -200,7 +198,7 @@ going to this trouble is when writing a source scrambler. The C filter (which unscrambles the source before Perl parses it) included with the source filter distribution is an example of a C source filter (see Decryption Filters, below). - + =over 5 @@ -412,6 +410,7 @@ Here is the complete Debug filter: package Debug; use strict; + use warnings; use Filter::Util::Call ; use constant TRUE => 1 ; @@ -510,8 +509,7 @@ doesn't know Perl. It can be fooled quite easily: EOM Such things aside, you can see that a lot can be achieved with a modest -amount of code. I<[Note that Tuomas' toy VRML parser on p. 17 had the -same difficulty parsing VRML strings that look like comments. -Jon]> +amount of code. =head1 CONCLUSION