develooper Front page | perl.perl5.porters | Postings from April 2000

[ID 20000429.001] overloaded require gives warnings regularrequire does not

Nick Ing-Simmons
April 29, 2000 02:14
[ID 20000429.001] overloaded require gives warnings regularrequire does not
Message ID:
This is a bug report for perl from,
generated with the help of perlbug 1.28 running under perl v5.6.0.

[Please enter your report here]

The simplest overload of require e.g.

#!perl -xw

sub myrequire (*)
 my ($mod) = @_;
 $mod =~ s,::,/,g;
 return $] >= $mod if $mod =~ /^\d+(\.\d+)?/;
 return CORE::require("$");

*CORE::GLOBAL::require = \&myrequire;

require base;

Produces :

Unquoted string "base" may clash with future reserved word at /tmp/bug line 15.
Unquoted string "fields" may clash with future reserved word at /usr/local/lib/perl5.006/share/ line 87.

It seems that normal require can handle lowercase barewords without
the warning but even with the (*) prototype you get the warning when redefined
as a sub. Note that 2nd message above is from itself, there is another
one in the warnings code.

[Please do not change anything below this line]
Site configuration information for perl v5.6.0:

Configured by nick at Mon Apr 17 08:27:36 BST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
    osname=linux, osvers=2.2.5, archname=i686-linux-thread-multi
    uname='linux bactrian 2.2.5 #56 sat oct 9 20:14:35 bst 1999 i686 unknown '
    config_args='-der -O -Dcc=gcc -Doptimize=-O2 -g -Dusemymalloc=n -Dusethreads=y -Duseithreads=y -Dusevfork=false'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=define
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
    cc='gcc', optimize='-O2 -g', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
    cppflags='-D_REENTRANT -DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccflags ='-D_REENTRANT -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.6.0:

Environment for perl v5.6.0:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/bin/bash Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About