in reply to acessing the contents of a file character by character

Why would you want to read a file character by character when you're looking for a pattern (like /blue/) that is longer than a single character? Not that it is impossible to do this, but it looks to me like you are setting up a "Blind Men and The Elephant"-type situation for yourself, for no good reason.

Any way, check out sysread.

the lowliest monk

  • Comment on Re: acessing the contents of a file character by character