Data::Filter

Filter data structures with structured filters
Download

Data::Filter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Matt Wilson
  • Publisher web site:
  • http://search.cpan.org/~mwilson/

Data::Filter Tags


Data::Filter Description

Filter data structures with structured filters Data::Filter is a Perl module to filter data structures with structured filters.Developer commentsThe structure of the data set is rarely in this format. However, I decided that this was the easiest method to determine (and guarantee) that recursive filters did not confuse the difference between records (as each record has it's own unique key). If, as is more likely, your data set is in an array format, like so; my @dataSet = ( { name => 'Data::Filter', author => 'Matt Wilson', }, { name => 'Pod::XML', author => 'Matt Wilson, }, # ... etc. );A helper function is provided to convert your array into the required hash reference form; my taSet = %{ arrayToHash ( @dataSet ) };Where arrayToHash obviously returns a hash reference.Similarly, the filterData subroutine returns a hash reference in the same form as the provided data set (hash reference, rather than array). As such, there is also a utility subroutine, hashToArray, to deal with such circumstances.Next, let's take a look at the format of the filtering array, as that's fairly important if you'd like to create any meaningful results!A filter is of the form;or, more complex;, , ],or, possibly;, ], , ]SYNOPSIS use Data::Filter; my taSet = ( 0 => { name => 'Data::Filter', author => 'Matt Wilson', }, 1 => { name => 'Pod::XML', author => 'Matt Wilson, }, # ... etc. ); my @filter = , , ]; my %result = %{ filterData ( taSet, \%filter ) }; Requirements: · Perl


Data::Filter Related Software