Perl class for I/O on in-core objects like strings and arrays