in reply to Are codefilters restricted to valid code?
I'm not sure that Filter::Simple is supposed to work with both, the filtering code and the filtered code in one file. I've split up your code into two files and then changed executable_no_comments to code and now it works :)
#!/usr/bin/perl package LanX; use strict; use Filter::Simple; my $transform = sub { warn "$_"; s{ X(\w+)\[ } {\$$1->\[}xg; s{ X(\w+) } {\$$1}xg; warn "=> $_"; $_; }; FILTER_ONLY "code" => $transform; #FILTER_ONLY "executable_no_comments" => $transform; 1;
and
#!/usr/bin/perl #use strict; BEGIN { require '732082-f.pm'; LanX->import(); }; Xarr=[1..3]; print "@Xarr";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Are codefilters restricted to valid code?
by LanX (Saint) on Dec 22, 2008 at 15:05 UTC |