The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

package TieOut;
use overload '"' => sub { "overloaded!" };
sub TIEHANDLE {
my $class = shift;
bless(\( my $ref), $class);
}
sub PRINT {
my $self = shift;
$$self .= join('', @_);
}
sub read {
my $self = shift;
return substr($$self, 0, length($$self), '');
}
1;