my $handle = gensym; open $handle, ref ($file) ? ">&". fileno ($file) : ">" . $file and binmode ($handle) or goto &_drat; #### the IO::String manpage, which is quite similar but which was designed more-recently and with an IO::Handle-like interface in mind, so you can mix OO- and native- filehandle usage without using tied(). Note: if anyone can make IO::Scalar do that without breaking the regression tests, I'm all ears. #### write ($file, $compressed) Write the in-memory archive to disk. The first argument can either be the name of a file or a reference to an already open file handle (be a GLOB reference). If the second argument is true, the #### Can't locate object method "FETCH" via package "IO::String" at /home/perl/lib/5.6.0/ppc-linux-thread-multi/Data/Dumper.pm line 150. #### tie *IOST, 'IO::String'; print Dumper \*IOST; #### FETCH This method will be triggered every time the tied variable is accessed (read). It takes no arguments beyond its self reference, which is the object representing the scalar we're dealing with. Because in this case we're using just a SCALAR ref for the tied scalar object, a simple $$self allows the method to get at the real value stored there. In our example below, that real value is the process ID to which we've tied our variable. #### open TRICKERY, \$stringamabob;