tiehandle.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl -w
BEGIN {
chdir 't' if -d 't';
}
my @expect;
my $data = "";
my @data = ();
require './test.pl';
sub compare {
for my $i (0..$#_) {
}
}
sub TIEHANDLE {
}
sub PRINT {
1;
}
sub PRINTF {
2;
}
sub READLINE {
}
sub GETC {
}
sub READ {
3;
}
sub WRITE {
}
sub CLOSE {
5;
}
use Symbol;
is($r, 1);
is($r, 2);
@expect = ();
$data = "abc";
$buf = "xyz";
$data = "abc";
is($r, 3);
$buf = "xyzasd";
$data = "abc";
is($r, 3);
$buf = "qwerty";
$data = "";
is($r, 4);
$buf = "qwerty";
$data = "";
is($r, 4);
$buf = "qwerty";
$data = "";
is($r, 6);
is($r, 5);
# Does aliasing work with tied FHs?
is($r, 1);
{
use warnings;
# Special case of aliasing STDERR, which used
# to dump core when warnings were enabled
}
{
# Test for change #11536
use strict;
sub READ {
$_[1] = $cnt++;
1;
}
sub do_read {
my $fh = shift;
}
$|=1;
}
{
# test for change 11639: Can't localize *FH, then tie it
{
local *foo;
}
{
local *bar;
}
{
local *BAZ;
}
}
{
# warnings should pass to the PRINT method of tied STDERR
my @received;
use warnings;
print undef;
}
{
# [ID 20020713.001] chomp($data=<tied_fh>)
local *TEST;
my $data;
}