use 5.008000; # Requires Perl 5.8.0 or higher my $var = ''; open(my $fh, '>', \$var) or die("Unable to open mem file: $!"); print $fh 'moo!'; print(length($var), "\n"); # Prints '4'.
In earlier versions, IO::Scalar might do the trick.
In reply to Re: write from filehandle to variable
by ikegami
in thread write from filehandle to variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |