io_linenum.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
# test added 29th April 1999 by Paul Johnson (pjcj@transeda.com)
# updated 28th May 1999 by Paul Johnson
my $File;
{
if (-d 't')
{
chdir 't';
$File =~ s/^t\W+//; # Remove first directory
}
}
use Test;
sub lineno
{
my ($f) = @_;
my $l;
$l .= "$. ";
$l .= $f->input_line_number;
$l .= " $."; # check $. before and after input_line_number
$l;
}
my $t;
<F> for (1 .. 10);
<F>;
$t = tell F; # tell F; provokes a warning
<F>;
select F;
<F> for (1 .. 10);
$t = tell F;
# We used to have problems here before local $. worked.
# input_line_number() used to use select and tell. When we did the
# same, that mechanism broke. It should work now.
{
local $.;
}