PerlIO::Scalar

Supports in-memory I/O. It exists so it can use XSLoader to load C code that supports treating a scalar as an "in-memory" file. PerlIO::Scalar allows all normal file operations to be performed on the handle. Returns undef.

For example:

#!/usr/local/bin/perl -w use PerlIO::Scalar; open($fh, "<...", \$some_scalar);

This module is part of the core Perl distribution starting with Perl 5.8.