in reply to Re: Filter objects?
in thread Filter objects?

Thanks for the grep code. I have tried a variation on you code as follows:
perl -le 'print join " ", grep { $_ =~ /start4/ | $_ =~ /end7/ } (st +art4,end7)'
How would you advance on this to produce a condition of print if the end position minus the start position is greater than 3?

Replies are listed 'Best First'.
Re: Re: Re: Filter objects?
by Anonymous Monk on Jan 29, 2003 at 09:18 UTC
    I have answered the question myself.
    perl -le '$a = join " ", grep { $_ == 4 } (4); $b = join " ", grep { + $_ == 7 } (7); $c = $b-$a; print $c;'