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

[ID 20000429.001] overloaded require gives warnings regularrequire does not

From:
Nick Ing-Simmons
Date:
April 29, 2000 02:14
Subject:
[ID 20000429.001] overloaded require gives warnings regularrequire does not
Message ID:
200004290913.KAA05952@bactrian.ni-s.u-net.com
This is a bug report for perl from nick@bactrian.ni-s.u-net.com,
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

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

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

require base;
__END__

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/base.pm 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 base.pm itself, there is another
one in the warnings code.



[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
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:
  Platform:
    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
  Compiler:
    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:
    /usr/local/lib/perl5.006/i686-linux-thr
    /usr/local/lib/perl5.006/share
    /usr/local/lib/perl5.006/site/i686-linux-thr
    /usr/local/lib/perl5.006/site/share
    /usr/local/lib/perl5.006/site/share
    .

---
Environment for perl v5.6.0:
    HOME=/home/nick
    LANG=en_GB.ISO-8859-1
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/nick/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/openwin/bin:/usr/games/bin:/usr/games:/opt/gnome/bin:/opt/kde/bin:.
    PERL_BADLANG (unset)
    SHELL=/bin/bash



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About