Ulrich Wisser <[EMAIL PROTECTED]> wrote in libwww :
>
> Somewhere in a (of course lost) doc I read
> that it is possible to use a reference of some
> kind in the same way as a filehandle. So it
> can be printed to and read from the scalar (string).
>
> Of course that would be very handy with the cookie_jar
> save and load functions.
>
> Is just my memory that bad or is it indeed possible?
IIRC, this is possible if the following command :
$ perl -V:useperlio
returns :
useperlio='define';
In this case, you can do :
#!perl
open STRINGHANDLE, '>', \$str;
print STRINGHANDLE "foo";
close STRINGHANDLE;
print "<$str>\n";
open STRINGHANDLE, '<', \$str;
$str2 = <STRINGHANDLE>;
close STRINGHANDLE;
print "<$str2>\n";
__END__