Have you seen the article in the File::Slurp distribution? At it's core, it's doing something very similar to the "read" approach. I'd guess the speed difference you're seeing is due to the option/error/context checking that it's doing, which your hand-coded example is not.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re^3: Speed reading (files)
by xdg
in thread Speed reading (files)
by kwaping
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |