in reply to Re: Re: Re: Re: Generating a grep command at run time
in thread Generating a grep command at run time

hardburn,
Your example is just changing the default buffer window - it is still reading it exactly as I have described. This is not faster than $var = <FH>; if you set the buffer smaller than the default. The only advantage speed wise to this method is if you do not care about newlines, which it appears that chimni is interested in. Now, it is possible to use a large buffer and write your own newline handler for reading through the buffer - you have to be sure to prepend whatever is left over on the last "line" on the next read to make sure lines that split are handled correctly. This seems like a lot more work to me - if you need that much speed - use the *nix grep.

Cheers - L~R

  • Comment on Re: Re: Re: Re: Re: Generating a grep command at run time