IO::String for Perl6
Switch branches/tags
Nothing to show
Latest commit 8a21f6f Nov 1, 2016 @hoelzro committed on GitHub Merge pull request #4 from zoffixznet/patch-1
Add mandatory "perl" META field
Failed to load latest commit information.
lib/IO Have readchars return Str if at EOF Mar 9, 2016
t Test readchars is Str when at EOF Mar 9, 2016
.travis.yml Add Travis support Jul 9, 2015
LICENSE Add license Aug 8, 2014 Add mandatory "perl" META field Oct 26, 2016 Add README Aug 8, 2014




        use IO::String;

        my $buffer =;
            my $*OUT = $buffer;
            say "hello";
        say ~$buffer; # hello


Sometimes you want to use code that deals with files (or other file-like objects), but you don't want to mess around with creating temporary files. This includes uses like APIs that for some reason don't accept strings as well as files as targets, mocking I/O, or capturing output written to the terminal. That's why this module exists. Loosely based on Perl 5's IO::String.


  • Input as well as output
  • Handle encodings