1*0Sstevel@tonic-gatepackage PerlIO::scalar; 2*0Sstevel@tonic-gateour $VERSION = '0.02'; 3*0Sstevel@tonic-gateuse XSLoader (); 4*0Sstevel@tonic-gateXSLoader::load 'PerlIO::scalar'; 5*0Sstevel@tonic-gate1; 6*0Sstevel@tonic-gate__END__ 7*0Sstevel@tonic-gate 8*0Sstevel@tonic-gate=head1 NAME 9*0Sstevel@tonic-gate 10*0Sstevel@tonic-gatePerlIO::scalar - in-memory IO, scalar IO 11*0Sstevel@tonic-gate 12*0Sstevel@tonic-gate=head1 SYNOPSIS 13*0Sstevel@tonic-gate 14*0Sstevel@tonic-gate my $scalar = ''; 15*0Sstevel@tonic-gate ... 16*0Sstevel@tonic-gate open my $fh, "<", \$scalar or die; 17*0Sstevel@tonic-gate open my $fh, ">", \$scalar or die; 18*0Sstevel@tonic-gate open my $fh, ">>", \$scalar or die; 19*0Sstevel@tonic-gate 20*0Sstevel@tonic-gateor 21*0Sstevel@tonic-gate 22*0Sstevel@tonic-gate my $scalar = ''; 23*0Sstevel@tonic-gate ... 24*0Sstevel@tonic-gate open my $fh, "<:scalar", \$scalar or die; 25*0Sstevel@tonic-gate open my $fh, ">:scalar", \$scalar or die; 26*0Sstevel@tonic-gate open my $fh, ">>:scalar", \$scalar or die; 27*0Sstevel@tonic-gate 28*0Sstevel@tonic-gate=head1 DESCRIPTION 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gateA filehandle is opened but the file operations are performed "in-memory" 31*0Sstevel@tonic-gateon a scalar variable. All the normal file operations can be performed 32*0Sstevel@tonic-gateon the handle. The scalar is considered a stream of bytes. Currently 33*0Sstevel@tonic-gatefileno($fh) returns C<undef>. 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate=head1 IMPLEMENTATION NOTE 36*0Sstevel@tonic-gate 37*0Sstevel@tonic-gateC<PerlIO::scalar> only exists to use XSLoader to load C code that 38*0Sstevel@tonic-gateprovides support for treating a scalar as an "in memory" file. 39*0Sstevel@tonic-gateOne does not need to explicitly C<use PerlIO::scalar>. 40*0Sstevel@tonic-gate 41*0Sstevel@tonic-gate=cut 42