in reply to Eating RAM problem
sub by_string { my $file = shift; local *IN, $/; open( IN, $file ) or die "Cannot open '$file': $!"; return <IN>; }
Access each element with substr. Memory savings? Several bytes per character, because Perl doesn't have to create a new SV for each character.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Eating RAM problem
by TheFifthDeuce (Novice) on Aug 01, 2002 at 18:08 UTC | |
by rsteinke (Scribe) on Aug 01, 2002 at 18:50 UTC | |
by I0 (Priest) on Aug 02, 2002 at 07:03 UTC |