TB2::CanDupFilehandles - A role for duplicating filehandles
package Some::Thing; use TB2::Mouse; with 'TB2::CanDupFilehandles';
This role supplies a class with the ability to duplicate filehandles in a way which also copies IO layers such as UTF8.
It's most handy for Streamers.
my $duplicate = $obj->dup_filehandle($src); my $duplicate = $obj->dup_filehandle($src, $duplicate);
Creates a duplicate filehandle including copying any IO layers.
If you hand it an existing $duplicate filehandle it will overwrite it and return it. If it's undef, it will return a new one. This is handy as it will preserve the glob and fileno.
$obj->autoflush($fh);
Turns on autoflush for a filehandle.
To install Test::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Simple
CPAN shell
perl -MCPAN -e shell install Test::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.