This is really cool, thanks very much!
In the long term, I hope we eventually just switch over once everyone's happy
-- I get very nervous when environment variables get too prominent for
interpreting one's code...
On Oct 9, 2011, at 8:35 PM, chm wrote:
> PDL::NiceSlice users:
>
> I just pushed to PDL git a refactoring of the
> PDL::NiceSlice source filter to allow for
> different filter engines. Thus you can choose
> either the original engine based on the
> Filter::Util::Call module or the new filter
> engine using Filter::Simple by setting the
> environment variable PDL_NICESLICE_ENGINE to
> the desired engine module name.
>
> The new engine avoids source filter changes
> within perl comments/POD and within most
> string contexts (source filtering can still
> happen within the / / of a pattern operator.
> If this is an issue, just use the m/ / form
> instead).
>
> Here is an example of a test case based on
> the original sf.net bug report with a SQL query
> string being constructed in a string:
>
>> $ cat ttt.pm
>> use PDL::NiceSlice;
>>
>> $table = 'ZEB21';
>> $yr = 1991;
>> $schema = 'schema';
>>
>>
>> print qq{
>> CREATE TABLE $table (
>> CHECK ( yr = $yr )
>> ) INHERITS ($schema.master_table)
>> } . "\n";
>>
>
>
> This is the output from the original PDL::NiceSlice
> filter engine:
>
>> $ perl -Mblib ttt.pm
>>
>> CREATE TABLE ZEB21 ->nslice(CHECK(yr=1991)) INHERITS (schema.master_table)
>>
>
>
> Here is the result from the Filter::Simple engine:
>
>> $ PDL_NICESLICE_ENGINE='Filter::Simple' perl -Mblib ttt.pm
>>
>> CREATE TABLE ZEB21 (
>> CHECK ( yr = 1991 )
>> ) INHERITS (schema.master_table)
>>
>
>
> Enjoy!
> Chris
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl