in reply to File::Spew - a figment of my imagination?

File::Slurp has a write_file method, doesn't that do what you want?

  • Comment on Re: File::Spew - a figment of my imagination?

Replies are listed 'Best First'.
Re^2: File::Spew - a figment of my imagination?
by 1nickt (Canon) on Sep 10, 2015 at 13:57 UTC

    File::Slurp is broken, especially with regard to character encoding and I/O layers. It should be eschewed. File::Slurper is a modern replacement, or use Path::Tiny.

    The way forward always starts with a minimal test.

      OH! Is it still broken 4+ years later?

        Here's a recent blog post from Leon Timmermans (author of File::Slurper) titled "File::Slurp is broken and wrong".

        Personally, I have not had any issues using File::Slurp. But then again, I haven't used it in the problematic scenarios as described in the blog post and mentioned in the discussion link provided by 1nickt. Despite not encountering any issues so far, I'm thinking that I might want to revisit some of my older code to change them to not use File::Slurp to help avoid potential problems.