02_fetchsize.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
my $file = "tf$$.txt";
my $data = "rec1$:rec2$:rec3$:";
print "1..6\n";
my $N = 1;
print "ok $N\n"; $N++;
binmode F;
print F $data;
close F;
print $o ? "ok $N\n" : "not ok $N\n";
$N++;
$: = $o->{recsep};
my $n;
# 3 test array element count
$n = @a;
print $n == 3 ? "ok $N\n" : "not ok $N # n=$n\n";
$N++;
# 4 same thing again
$n = @a;
print $n == 3 ? "ok $N\n" : "not ok $N # n=$n\n";
$N++;
# 5 test $#a notation
$n = $#a;
print $n == 2 ? "ok $N\n" : "not ok $N # n=$n\n";
$N++;
# 6 test looping over array elements
my $q;
for (@a) { $q .= $_ }
$N++;
END {
undef $o;
untie @a;
}