Skip to content

Instantly share code, notes, and snippets.

@Tux
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tux/8ebe8af1949c2aced18b to your computer and use it in GitHub Desktop.
Save Tux/8ebe8af1949c2aced18b to your computer and use it in GitHub Desktop.
# I don't want this inside Text::CSV
class IO::String is IO::Handle {
use File::Temp;
multi method new (Str $str!) returns IO::Handle {
(my Str $filename, my $fh) = tempfile;
$fh.print ($str);
$fh.close;
return open $filename, :r, chomp => False;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment