tell.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
# $RCSfile: tell.t,v $$Revision$$Date$
print "1..23\n";
$TST = 'tst';
$firstline = <$TST>;
$secondpos = tell;
$x = 0;
while (<tst>) {
}
if ($x == 1) { print "ok 2\n"; } else { print "not ok 2\n"; }
if ($. == 0) { print "not ok 14\n"; } else { print "ok 14\n"; }
$curline = $.;
{
local($.);
if ($. == 0) { print "not ok 15\n"; } else { print "ok 15\n"; }
if ($. == 0) { print "ok 16\n"; } else { print "not ok 16\n"; }
$. = 5;
if ($. == 6) { print "ok 17\n"; } else { print "not ok 17\n"; }
}
{
local($.);
if ($. == 7) { print "ok 19\n"; } else { print "not ok 19\n"; }
}
{
local($.);
if ($. == 7) { print "ok 21\n"; } else { print "not ok 21\n"; }
}
# ftell(STDIN) (or any std streams) is undefined, it can return -1 or
# something else. ftell() on pipes, fifos, and sockets is defined to
# return -1.