lib/Tie/File/t/42_offset.t Unit tests for the offset method
lib/Tie/Handle.pm Base class for tied handles
lib/Tie/Handle/stdhandle.t Test for Tie::StdHandle
+lib/Tie/Handle/stdhandle_from_handle.t Test for Tie::StdHandle/Handle backwards compat
lib/Tie/Hash/NamedCapture.pm Implements %- and %+ behaviour
lib/Tie/Hash.pm Base class for tied hashes
lib/Tie/Memoize.pm Base class for memoized tied hashes
lib/Tie/RefHash/threaded.t Test for Tie::RefHash with threads
lib/Tie/Scalar.pm Base class for tied scalars
lib/Tie/Scalar.t See if Tie::Scalar works
+lib/Tie/StdHandle.pm Tie::StdHandle
lib/Tie/SubstrHash.pm Compact hash for known key, value and table size
lib/Tie/SubstrHash.t Test for Tie::SubstrHash
lib/Time/gmtime.pm By-name interface to Perl's builtin gmtime
use 5.006_001;
our $VERSION = '4.1';
+# Tie::StdHandle used to be inside Tie::Handle. For backwards compatibility
+# loading Tie::Handle has to make Tie::StdHandle available.
+use Tie::StdHandle;
+
=head1 NAME
-Tie::Handle, Tie::StdHandle - base class definitions for tied handles
+Tie::Handle - base class definitions for tied handles
=head1 SYNOPSIS
croak "$pkg doesn't define a CLOSE method";
}
-package Tie::StdHandle;
-our @ISA = 'Tie::Handle';
-use Carp;
-
-sub TIEHANDLE
-{
- my $class = shift;
- my $fh = \do { local *HANDLE};
- bless $fh,$class;
- $fh->OPEN(@_) if (@_);
- return $fh;
-}
-
-sub EOF { eof($_[0]) }
-sub TELL { tell($_[0]) }
-sub FILENO { fileno($_[0]) }
-sub SEEK { seek($_[0],$_[1],$_[2]) }
-sub CLOSE { close($_[0]) }
-sub BINMODE { binmode($_[0]) }
-
-sub OPEN
-{
- $_[0]->CLOSE if defined($_[0]->FILENO);
- @_ == 2 ? open($_[0], $_[1]) : open($_[0], $_[1], $_[2]);
-}
-
-sub READ { read($_[0],$_[1],$_[2]) }
-sub READLINE { my $fh = $_[0]; <$fh> }
-sub GETC { getc($_[0]) }
-
-sub WRITE
-{
- my $fh = $_[0];
- print $fh substr($_[1],0,$_[2])
-}
-
-
1;
@INC = '../lib';
}
-use Tie::Handle;
+use Tie::StdHandle;
tie *tst,Tie::StdHandle;
$f = 'tst';
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+use Test::More tests => 1;
+
+use Tie::Handle;
+
+{
+ package Foo;
+ @ISA = qw(Tie::StdHandle);
+}
+
+# For backwards compatabilty with 5.8.x
+ok( Foo->can("TIEHANDLE"), "loading Tie::Handle loads TieStdHandle" );
--- /dev/null
+package Tie::StdHandle;
+
+use Tie::Handle;
+our @ISA = 'Tie::Handle';
+use Carp;
+
+sub TIEHANDLE
+{
+ my $class = shift;
+ my $fh = \do { local *HANDLE};
+ bless $fh,$class;
+ $fh->OPEN(@_) if (@_);
+ return $fh;
+}
+
+sub EOF { eof($_[0]) }
+sub TELL { tell($_[0]) }
+sub FILENO { fileno($_[0]) }
+sub SEEK { seek($_[0],$_[1],$_[2]) }
+sub CLOSE { close($_[0]) }
+sub BINMODE { binmode($_[0]) }
+
+sub OPEN
+{
+ $_[0]->CLOSE if defined($_[0]->FILENO);
+ @_ == 2 ? open($_[0], $_[1]) : open($_[0], $_[1], $_[2]);
+}
+
+sub READ { read($_[0],$_[1],$_[2]) }
+sub READLINE { my $fh = $_[0]; <$fh> }
+sub GETC { getc($_[0]) }
+
+sub WRITE
+{
+ my $fh = $_[0];
+ print $fh substr($_[1],0,$_[2])
+}
+
+
+1;