Last week my Perl interpreter suddenly started issuing a bizarre cascade of warnings every time I tried to run my 'sitegen.pl' script. These warnings claimed that every variable exported from my 'Plx.pm' library had already been defined. It then aborted the interpretation of 'sitegen.pl' entirely at the first invocation of one of these "multiply defined" functions.

My 'sitegen.pl' script begins with the following 4 "use" statements:

use Plx; # Programming Language Extensions use PlxHml; # HTML Macro Languages use PlxLang; # Language Services use strict 'vars';

'Plx.pm' exports 23 functions and begins:

package PLX; use attributes; use diagnostics; use strict 'vars'; use warnings; use Date::Calc; use Math::BigFloat; use Carp; $SIG{__WARN__} = \&carp; $SIG{__DIE__} = \&confess;

'PlxHml.pm' exports 1 function and begins:

package PLXHML; use PLX; use Carp; $SIG{__WARN__} = \&carp; $SIG{__DIE__} = \&confess;

'PlxLang.pm' exports 3 functions and begins:

package PLXLANG; use PLX; use Carp; $SIG{__WARN__} = \&carp; $SIG{__DIE__} = \&confess;

Each of the exported functions is unique. This structure has worked for years without error.

My Perl site lib contains the following files:

-------------------------------------------------------------------- c:\Perl64\site\lib()dir Volume in drive C is C-DRIVE Volume Serial Number is E812-30A4 Directory of c:\Perl64\site\lib 01/13/2017 07:34 AM <DIR> . 01/13/2017 07:34 AM <DIR> .. 09/02/2010 02:49 PM <DIR> auto 09/02/2010 02:49 PM <DIR> Image 01/13/2017 07:34 AM 161,042 Plx.pm 01/09/2017 04:33 PM 10,113 PlxHml.pm 01/11/2017 10:28 AM 15,241 PlxLang.pm 01/11/2017 10:27 AM 61,873 PlxSync.pm 01/27/2010 01:36 PM 31 sitecustomize.pl 12/26/2010 01:13 AM 106 test.pm 6 File(s) 248,406 bytes 4 Dir(s) 651,360,083,968 bytes free --------------------------------------------------------------------

The command I use to interpret sitegen.pl, and the first few and last few of the spurious errors, are:

-------------------------------------------------------------------- c:\!dh\dh\web\PRC\1()sitegen.pl Subroutine TRUE redefined at C:/Perl64/site/lib/PLX.pm line 280 (#1) (W redefine) You redefined a subroutine. To suppress this warning +, say { no warnings 'redefine'; eval "sub name { ... }"; } Subroutine TRUE redefined at C:/Perl64/site/lib/PLX.pm line 280. at C:/Perl64/site/lib/PlxHml.pm line 13 (#1) Subroutine TRUE redefined at C:/Perl64/site/lib/PLX.pm line 280. at C:/Perl64/site/lib/PlxHml.pm line 13 at C:/Perl64/site/lib/PlxHml.pm line 13 Subroutine FALSE redefined at C:/Perl64/site/lib/PLX.pm line 281 (#1) Subroutine FALSE redefined at C:/Perl64/site/lib/PLX.pm line 281. . . . Subroutine x_yyyy_mm_dd_hh_mm_ss redefined at (#2) line 3990 (#1) Subroutine x_yyyy_mm_dd_hh_mm_ss redefined at (#2) line 3990. at C:/Perl64/site/lib/PlxHml.pm line 13 Undefined subroutine &main::x_hh_mm_ss called at C:\!dh\dh\web\PRC\1\s +itegen.pl line 347. at C:\!dh\dh\web\PRC\1\sitegen.pl line 347 --------------------------------------------------------------------

Line 280 of Plx.pm is:

  sub TRUE      {1}

Line 13 of PlxHml.pm is:

  use PLX;

I suspect that there's a simple explanation for all this, but even after a decade of using Perl, I am unable to imagine what it is. Do these spurious errors ring a bell with anyone? The version of Perl I use is described by the following output from the 'perl -v' and 'perl -V' commands:

------------------- Output from perl -v ------------------- This is perl, v5.10.1 built for MSWin32-x64-multi-thread (with 2 registered patches, see perl -V for more detail) Copyright 1987-2009, Larry Wall Binary build 1007 [291969] provided by ActiveState http://www.Active +State.com Built Jan 27 2010 14:12:21 Perl may be copied only under the terms of either the Artistic Licen +se or the GNU General Public License, which may be found in the Perl 5 source +kit. Complete documentation for Perl, including FAQ lists, should be foun +d on this system using "man perl" or "perldoc perl". If you have access +to the Internet, point your browser at http://www.perl.org/, the Perl Home +Page. ------------------- Output from perl -V ------------------- Summary of my perl5 (revision 5 version 10 subversion 1) configurati +on: Platform: osname=MSWin32, osvers=5.2, archname=MSWin32-x64-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=u +ndef use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL -Wp6 +4 -fp:precise -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DWIN6 +4 -DCONSERVATIVE -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMP +LICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX' +, optimize='-MD -Zi -DNDEBUG -Ox -GL -Wp64 -fp:precise', cppflags='-DWIN32' ccversion='14.00.40310.41', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=123456 +78 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize= +8 ivtype='__int64', ivsize=8, nvtype='double', nvsize=8, Off_t='__ +int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf - +ltcg -libpath:"C:\Perl64\lib\CORE" -machine:AMD64' libpth=\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.l +ib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib net +api32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.l +ib odbccp32.lib comctl32.lib bufferoverflowU.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspo +ol.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib + netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc +32.lib odbccp32.lib comctl32.lib bufferoverflowU.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -op +t:ref,icf -ltcg -libpath:"C:\Perl64\lib\CORE" -machine:AMD64' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_64_BIT +_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 1007 [291969] 0abd0d disable non-unicode case insensitive trie matching Built under MSWin32 Compiled at Jan 27 2010 14:12:21 @INC: C:/Perl64/site/lib C:/Perl64/lib . --------------------------------------------------------------------

I suppose I could reinstall ActivePerl, but they're no longer friendly to freeloaders like me and this might not succeed. I could try Strawberry Perl, but I don't have LINUX and managing it might be difficult. Before I descend into these circles of hell, I really hope that one of the wise elders here can offer me even a glimmer -- even just a smudgeon -- of insight. Thanks in advance.


In reply to Undiagnosable Problem by dhannotte

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.