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

my $str = "yo ho ho\n"; open my($fh), '+<', \$str; print <$fh>; print $fh "and a bottle\n"; print $str; __END__ yo ho ho yo ho ho and a bottle
  • Comment on Re: Best way to read a file into memory and use normal operation on memory file?
  • Download Code

Replies are listed 'Best First'.
Re^2: Best way to read a file into memory and use normal operation on memory file?
by Anonymous Monk on Jul 16, 2014 at 03:00 UTC
    Naturally this needs use v5.8.0;, for perl v5.6 you need IO::String