Subject: | 'version' set unknown stat on uninitilized glob (?) |
Date: | Fri, 10 Jul 2009 04:01:43 +0900 |
To: | bug-version [...] rt.cpan.org |
From: | kpee <kpee.cpan [...] gmail.com> |
Hi, John.
This is a little-rare-case bug(?), but it is surely happened.
[[ CASE A ]]
Magical glob '*_' returns unknown stat when it is not initialized.
A comprehensible example,
$ perl -we 'print stat *_,$/'
stat() on unopened filehandle _ at -e line 1.
but if type below
$ perl -w -Mversion -e 'print stat *_,$/'
303306010030123532023712204174641220417464
Returned value is always the same, but it is different according to the
platform.
It happens on both of Linux and Windows. See 'TEST ENVIRONMENT' at the
end of this report.
[[ CASE B ]]
On Windows, every uninitialized glob (e.g. *F) returns unknown stat.
@perl -w -e "print stat *F,$/"
Name "main::F" used only once: possible typo at -e line 1.
stat() on unopened filehandle F at -e line 1.
@perl -w -Mversion -e "print stat *F,$/"
Name "main::F" used only once: possible typo at -e line 1.
303320610030120685930212068593021206859302
Returned value is the same as the case of *_.
And,
@perl -w -Mversion -e "stat 'foo';print stat *F,$/"
Name "main::F" used only once: possible typo at -e line 1.
20332061002516124713303112471507961247133031
returns stat of 'foo'.
[[ TEST ENVIRONMENT ]]
* version-0.76, perl-v5.10.0 built for MSWin32-x86-multi-thread
(ActivePerl), Windows XP SP3
* version-0.76, perl- v5.8.8 built for i486-linux-gnu-thread-multi,
Linux ubuntu-vm 2.6.24-18-generic(on vmware-player for Windows)
[[ NOTICE ]]
* Module 'Encode-2.33' also has the same bug.
-- kpee <kpee.cpan@gmail.com>