in reply to getfile( $filename )
c.f File::Slurp
use File::Slurp; my @lines = read_file( $filename );
Also see the article in that distribution on file slurping and efficiency. It sugggests reading the file in one shot and then splitting on newlines instead of reading line-by-line.
-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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: getfile( $filename )
by harleypig (Monk) on Jul 29, 2005 at 18:11 UTC | |
by QM (Parson) on Aug 03, 2005 at 20:25 UTC | |
by harleypig (Monk) on Aug 06, 2005 at 16:04 UTC | |
by QM (Parson) on Aug 07, 2005 at 16:12 UTC |