X
Xavier Noria
Looks like source filters do not filter at runtime:
In this example the second pass is not seen by perl:
% perl -wle 'pass;
use Acme:
ythonic;
pass
'
Unquoted string "pass" may clash with future reserved word at -e line
1.
Useless use of a constant in void context at -e line 1.
but in this one it is not filtered out:
% perl -wle 'pass;
quote> require Acme:
ythonic;
quote> pass
quote> '
Unquoted string "pass" may clash with future reserved word at -e line
1.
Unquoted string "pass" may clash with future reserved word at -e line
4.
Useless use of a constant in void context at -e line 1.
Useless use of a constant in void context at -e line 3.
Since perlfilter says "require" opens a source stream as well as "use"
and also "A source filter is a special kind of Perl module that
intercepts and modifies a source stream before it reaches the parser."
I guessed source filters would filter if they were required (not that
perlfilter says it). But the experiments prove me wrong.
I imagine that since the compilation was already done nothing remains
to be parsed, but I don't know perl internals so I would like to
confirm the reason that's that way.
Why source filters don't filter with require or eval STRING?
-- fxn
In this example the second pass is not seen by perl:
% perl -wle 'pass;
use Acme:
pass
'
Unquoted string "pass" may clash with future reserved word at -e line
1.
Useless use of a constant in void context at -e line 1.
but in this one it is not filtered out:
% perl -wle 'pass;
quote> require Acme:
quote> pass
quote> '
Unquoted string "pass" may clash with future reserved word at -e line
1.
Unquoted string "pass" may clash with future reserved word at -e line
4.
Useless use of a constant in void context at -e line 1.
Useless use of a constant in void context at -e line 3.
Since perlfilter says "require" opens a source stream as well as "use"
and also "A source filter is a special kind of Perl module that
intercepts and modifies a source stream before it reaches the parser."
I guessed source filters would filter if they were required (not that
perlfilter says it). But the experiments prove me wrong.
I imagine that since the compilation was already done nothing remains
to be parsed, but I don't know perl internals so I would like to
confirm the reason that's that way.
Why source filters don't filter with require or eval STRING?
-- fxn