in reply to Buffered read and matching

Use Sys::Mmap, map the file, and treat it as a string. The OS is smart enough to deal with it.