.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "IO::TieCombine 3" .TH IO::TieCombine 3 2026-08-26 "perl v5.44.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH SYNOPSIS .IX Header "SYNOPSIS" First, we set up a bunch of access points: .PP .Vb 1 \& my $hub = IO::TieCombine\->new; \& \& my $str_ref = $hub\->scalar_ref(\*(Aqx\*(Aq); \& my $fh = $hub\->fh(\*(Aqx\*(Aq); \& my $callback = $hub\->callback(\*(Aqx\*(Aq); \& \& tie my $scalar, $hub, \*(Aqx\*(Aq; \& tie local *STDOUT, $hub, \*(Aqx\*(Aq; \& \& tie local *STDERR, $hub, \*(Aqerr\*(Aq; .Ve .PP Then we write to things: .PP .Vb 6 \& $$str_ref .= \*(AqAnd \*(Aq; \& print $fh "now "; \& $callback\->(\*(Aqfor \*(Aq); \& $scalar .= \*(Aqsomething \*(Aq; \& print "completely "; \& warn "different.\en"; .Ve .PP And then: .PP .Vb 3 \& $hub\->combined_contents; # And now for something completely different. \& $hub\->slot_contents(\*(Aqx\*(Aq); # And now for something completely \& $hub\->slot_contents(\*(Aqerr\*(Aq); # different. .Ve .PP \&\fBACHTUNG!!\fR Because of a serious problem with Perl 5.10.0, output sent to a tied filehandle using \f(CW\*(C`say\*(C'\fR \fBwill not have the expected newline\fR. 5.10.1 or later is needed. Since 5.10.0 is broken in so many other ways, you should really upgrade anyway. .PP \&\fBACHTUNG!!\fR Because of a different problem with Perls 5.10.1 \- 5.16.3, if you send output to a tied filehandle using \f(CW\*(C`say\*(C'\fR, and \f(CW\*(C`$\e\*(C'\fR is undefined (which is the default), \fR\f(CB\*(C`$\e\*(C'\fR\fB will not be restored to \fR\f(CB\*(C`undef\*(C'\fR\fB after the \fR\f(CB\*(C`say\*(C'\fR\fB\fR! This means that once you\*(Aqve used \f(CW\*(C`say\*(C'\fR to print to \fIany\fR tied filehandle, you have corrupted the global state of your program. Either start your program by setting \f(CW\*(C`$\e\*(C'\fR to an empty string, which should be safe, or upgrade to 5.18.0. .PP The constructor takes no arguments. .PP This method returns the contents of all collected data. .PP .Vb 1 \& my $str = $hub\->slot_contents( $slot_name ); .Ve .PP This method returns the contents of all collected data for the named slot. .PP .Vb 1 \& $hub\->clear_slot( $slot_name ); .Ve .PP This sets the slot back to an empty string. .PP .Vb 1 \& my $fh = $hub\->fh( $slot_name ); .Ve .PP This method returns a reference to a tied filehandle. When printed to, output is collected in the named slot. .PP .Vb 1 \& my $str_ref = $hub\->scalar_ref( $slot_name ); .Ve .PP This method returns a reference to scalar. When appended to, the new content is collected in the named slot. Attempting to alter the string other than by adding new content to its end will result in an exception. .PP .Vb 1 \& my $code = $hub\->callback( $slot_name ); .Ve .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 55:" 4 .IX Item "Around line 55:" Unknown directive: =method .IP "Around line 72:" 4 .IX Item "Around line 72:" Unknown directive: =method .IP "Around line 83:" 4 .IX Item "Around line 83:" Unknown directive: =method .IP "Around line 118:" 4 .IX Item "Around line 118:" Unknown directive: =method .IP "Around line 132:" 4 .IX Item "Around line 132:" Unknown directive: =method .IP "Around line 162:" 4 .IX Item "Around line 162:" Unknown directive: =method .IP "Around line 191:" 4 .IX Item "Around line 191:" Unknown directive: =method