in reply to Re: Best way to read a file into memory and use normal operation on memory file?
in thread Best way to read a file into memory and use normal operation on memory file?
Is there any reason this has to be done as a file in memory, instead of a simple scalar? Just replace your
syswrite $mem_file, pack( "v*", unpack("n*", $data ));with
$mem_file .= pack( "v*", unpack("n*", $data ));And of course, simply use my $mem_file; instead of the open my $mem_file...;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Best way to read a file into memory and use normal operation on memory file?
by james28909 (Deacon) on Jul 16, 2014 at 23:17 UTC |