in reply to Re: Re: Finding part of a file
in thread Finding part of a file

Nifty... I didn't know that the flip flop returned anything other than 1 or 0.
% perl -lne 'printf "%-6s %s\n", $_, scalar(/^banana$/ .. /^grape$/) +' fruit.txt apple banana 1 pear 2 peach 3 grape 4E0 orange
So, I can tweak my one-liner to exclude the endpoints like so:
% perl -ne 'print unless (/^banana$/ .. /^grape$/) =~ /^1?$|E/' fruit +.txt pear peach
Update:
Doh!, runrigs second stanza was added while I was replying.... I guess obfuscated minds think alike. ;-)

-Blake