Query: io::tiecombine
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
IO::TieCombine(3pm) User Contributed Perl Documentation IO::TieCombine(3pm)NAMEIO::TieCombine - produce tied (and other) separate but combined variablesVERSIONversion 1.002SYNOPSISFirst, we set up a bunch of access points: my $hub = IO::TieCombine->new; my $str_ref = $hub->scalar_ref('x'); my $fh = $hub->fh('x'); my $callback = $hub->callback('x'); tie my $scalar, $hub, 'x'; tie local *STDOUT, $hub, 'x'; tie local *STDERR, $hub, 'err'; Then we write to things: $$str_ref .= 'And '; print $fh "now "; $callback->('for '); $scalar .= 'something '; print "completely "; warn "different. "; And then: $hub->combined_contents; # And now for something completely different. $hub->slot_contents('x'); # And now for something completely $hub->slot_contents('err'); # different. ACHTUNG!! Because of a serious problem with Perl 5.10.0, output sent to a tied filehandle using "say" will not have the expected newline. 5.10.1 or later is needed. Since 5.10.0 is broken in so many other ways, you should really upgrade anyway.METHODSnew The constructor takes no arguments. combined_contents This method returns the contents of all collected data. slot_contents my $str = $hub->slot_contents( $slot_name ); This method returns the contents of all collected data for the named slot. clear_slot $hub->clear_slot( $slot_name ); This sets the slot back to an empty string. fh my $fh = $hub->fh( $slot_name ); This method returns a reference to a tied filehandle. When printed to, output is collected in the named slot. scalar_ref my $str_ref = $hub->scalar_ref( $slot_name ); 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. callback my $code = $hub->callback( $slot_name );AUTHORRicardo SIGNES <rjbs@cpan.org>COPYRIGHT AND LICENSEThis software is copyright (c) 2012 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-02-26 IO::TieCombine(3pm)
Related Man Pages |
---|
hubd(7d) - sunos |
hubd(7d) - minix |
io::tiecombine(3pm) - debian |
hubd(7d) - debian |
hubd(7d) - osx |
Similar Topics in the Unix Linux Community |
---|
Full duplex at HUB? |
how do i make this run 3com |
Azureus: Vuze 4.2.0.2 Released! |
AIX on IBM 7318 P10 |