
Tie::Handle::Scalar - Perl extension for tieing a scalar to a filehandle.

use Tie::Handle::Scalar;
my $file = "This is a test";
tie *FH, 'Tie::Handle::Scalar', \$file;
print FH "\nAnother line\n\n\n\n";
while (<FH>) {
print;
}
untie FH;

WARNING - This ONLY works with perl version 5.6.0< or above. This may be due to interfaces to handles in older versions of perl not being complete ;) Tie::Handle::Scalar allows you to tie a scalar to a filehandle. Supported and unsupported/untested methods are listed below. I wrote this before I realised there were 2 other modules that do something similar.... IO::Stringy and IO::String. These two may work better for you. But I couldn't get either of them to work with Net::FTP as they don't appear to support the FILENO method.



Andy Williams (andy.williams@lampsolutions.co.uk)

Please direct any bugs/fixes to the author.

perl(1). IO::Stringy. IO::String

Dave Cross (dave@dave.org.uk) for answering most if not all my questions.

Copyright 2001 Andy Williams. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.