GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  IO::TIECOMBINE (3)

.ds Aq ’

NAME

IO::TieCombine - produce tied (and other) separate but combined variables

CONTENTS

VERSION

version 1.005

SYNOPSIS

First, 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.\n";



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.



<B>ACHTUNG!!B> Because of a serious problem with Perl 5.10.0, output sent to a tied filehandle using say <B>will not have the expected newlineB>. 5.10.1 or later is needed. Since 5.10.0 is broken in so many other ways, you should really upgrade anyway.

<B>ACHTUNG!!B> Because of a different problem with Perls 5.10.1 - 5.16.3, if you send output to a tied filehandle using say, and $\ is undefined (which is the default), <B>B>$\<B> will not be restored to B>undef<B> after the B>say<B>B>! This means that once you’ve used say to print to any tied filehandle, you have corrupted the global state of your program. Either start your program by setting $\ to an empty string, which should be safe, or upgrade to 5.18.0.

METHODS

    new

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 );



AUTHOR

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 IO::TIECOMBINE (3) 2015-10-31

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.