I can confirm the bug (ActivePerl 5.12.1). It doesn't happen with PERLIO=:crlf on a linux machine. (5.12.2, default build config).
Here's a good demonstration:
#!/usr/bin/perl use strict; use warnings; my @data_positions = tell(DATA); while (<DATA>){ if (/^__DATA__$/) { push @data_positions, tell(DATA); } } my @fh_positions; open(my $fh, '<', $0) or die; while (<$fh>){ if (/^__DATA__$/) { push @fh_positions, tell($fh); } } print("@data_positions\n"); print("@fh_positions\n"); __DATA__ ab __DATA__ ab __DATA__ ab __DATA__ lotsa junk nothing
389 401 414 426 389 403 419 433
In reply to Re^7: Unexpected result using tell/seek within the __DATA__ file
by ikegami
in thread Unexpected result using tell/seek within the __DATA__ file
by Gulliver
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |