in reply to Best way to read a file into memory and use normal operation on memory file?

Something like this?
use File::Slurp; my $file_content = File::Slurp::read_file('file'); $file_content = reverse $file_content; my $memory_file = \$file_content; open my $memfh, '<', $memory_file or die "$!\n"; #...seek #...read close $memfh;
For details see these articles from the FAQ:
read-in-an-entire-file-all-at-once and
open-a-filehandle-to-a-string
  • Comment on Re: Best way to read a file into memory and use normal operation on memory file?
  • Download Code