Front page | perl.perl5.porters |
Postings from May 2012
[perl #112856] Exporter POD unclear, require_version sub and Module Version Checking
Thread Previous
From:
bulk 88
Date:
May 11, 2012 01:57
Subject:
[perl #112856] Exporter POD unclear, require_version sub and Module Version Checking
Message ID:
rt-3.6.HEAD-4610-1336726630-1173.112856-75-0@perl.org
# New Ticket Created by bulk 88
# Please include the string: [perl #112856]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=112856 >
This is a bug report for perl from bulk88@hotmail.com,
generated with the help of perlbug 1.39 running under perl 5.12.2.
-----------------------------------------------------------------
[Please describe your issue here]
In Exporter.pm's POD it states
_______________________________________
The Exporter module will convert an attempt to import a number from a module into a call to $module_name->require_version($value) . This can be used to validate that the version of the module being used is greater than or equal to the required version.
_______________________________________
I got a call to my module's VERSION sub from Heavy.pm from this chunk of code in Heavy.pm,
_______________________________________
foreach $sym (@imports) {
if (!$export_cache->{$sym}) {
if ($sym =~ m/^\d/) {
$pkg->VERSION($sym); # inherit from UNIVERSAL
# If the version number was the only thing specified
# then we should act as if nothing was specified:
if (@imports == 1) {
@imports = @$exports;
last;
}
_______________________________________
The use statement looked like this "use Some::Module '0.69';" . I do not believe that Exporter or Exporter::Heavy are capable of calling require_version when encountering a numeric export. The POD does not match what I think. A grep of my perl installation found only LWP::Protocol::ftp.pm making a call to require_version. Please either clarify my misassumption, fix the POD, or fix Heavy.pm's code to match the POD.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=library
severity=low
module=Exporter
---
Site configuration information for perl 5.12.2:
Configured by Owner at Wed Mar 23 08:05:23 2011.
Summary of my perl5 (revision 5 version 12 subversion 2) configuration:
Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -GF -W3 -Od -MD -Zi -DDEBUGGING -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO',
optimize='-Od -MD -Zi -DDEBUGGING',
cppflags='-DWIN32'
ccversion='13.10.3077', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -libpath:"c:\perl512\lib\CORE" -machine:x86'
libpth="c:\Program Files\Microsoft Visual Studio .NET 2003\VC7\lib"
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl512.lib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -libpath:"c:\perl512\lib\CORE" -machine:x86'
Locally applied patches:
---
@INC for perl 5.12.2:
C:/perl512/site/lib
C:/perl512/lib
.
---
Environment for perl 5.12.2:
HOME (unset)
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=C:\perl512\bin;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin;
PERL_BADLANG (unset)
PERL_JSON_BACKEND=JSON::XS
PERL_YAML_BACKEND=YAML
SHELL (unset)
Thread Previous