Philippe 'BooK' Bruhat wrote:
Hi,

[...]
>

The module works like this:

use Blah; # not a very good name for CPAN :-)

Acme::Blah! :o)

    my $blah = Blah->new(
        delimiter => ':',
        fields    => [qw( bap clank glipp plop )],
        show      => \&show_my_data,
    );

    # quelques infos utiles
    $blah->add_filter(
        bap   => 'eq "zlopp"',
        clank => '!~ /clunk_eth/',

A hash is unordered. Um hang on, or is this a list of pairs or a hash?

    );
    $blah->add_file( glob "*.log" );

    $blah->run;

When the run() method is called, the object compute a piece of Perl
code which is then eval()ed (with a localised @ARGV). The computed
code is the following (note the use of arrays for the selection pass
and of a hash for the processing):

    while(<>) {
        chomp;
        my @data = split qr{:};
        if(    ( $data[1] !~ /clunk_eth/ )
            && ( $data[0] eq "zlopp" ) )

This is ordered. But in any case, it's not in the same order as above.

I would like to be able to specify order in which the checks are run, so as to be able to evaluate the check that fails 99% of the time first.

Also, I'm not sure what to suggest, but...

    bap   => 'eq "zlopp"',

...feels icky. I'd rather something that would spit out errors at compile time, not at eval time. But I can't think of anything approaching that level of tersity. At the very least:

        bap   => { 'eq'      => 'zlopp'       }
        clunk => { '~!'      => qr/^foom\d+$/ }
        sput  => { 'between' => [10, 100]     }

Hmm, how do I add a new conditional widget, like 'between' above? e.g. I want to extract all HTTP transactions whose lengths are prime fibonacci numbers.

David



Reply via email to