develooper Front page | perl.perl5.porters | Postings from August 2001

[ID 20010816.007] subroutines in CORE::GLOBAL are not called

From:
=?iso-8859-1?Q?Murat_=DCnalan?=
Date:
August 16, 2001 05:38
Subject:
[ID 20010816.007] subroutines in CORE::GLOBAL are not called
Message ID:
000001c1264f$d6fb4d70$b97f58d9@gold
This is a bug report for perl from Administrator@localhost,
generated with the help of perlbug 1.28 running under perl v5.6.0.


-----------------------------------------------------------------
[Please enter your report here]

I found a bug posting at perl5-porters bug reports:

    [ID 20001220.004] CORE::GLOBAL support broken in 5.6.0

and do have a similar/related problem/bug.

Here we go:

I need a subroutine which gets called without an package identifier,
like an internal
perl function. Using CORE::GLOBAL:: package for that fails. I approached
the problem
with various strategies, but all fail.

The subroutine is correctly installed into the CORE::GLOBAL namespace
(as verfied by
a dump of the package):

 CORE::GLOBAL::
 CORE::GLOBAL::BEGIN                      *CORE::GLOBAL::BEGIN
 CORE::GLOBAL::flops                      *CORE::GLOBAL::flops

but produces this error when called from the appended perl code:

 Undefined subroutine &main::flops called at 11_export.t line 65.

Is there a update for the activeperl (win32) already ?

Thank you,
Murat

__PERL__

BEGIN
{
 package CORE::GLOBAL;

 use subs 'flops';

 sub flops { main::class(@_) }

 package main;
}

package main;

sub class
{
 print "Ohhh shit\n";
}

 flops( 'here it fails' );

 # this would work: 'CORE::GLOBAL::flops'->('this works');

__END__

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.6.0:

Configured by Administrator at Tue Oct 31 18:30:54 2000.

Summary of my perl5 (revision 5 version 6 subversion 0) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
  Compiler:
    cc='cl', optimize='-O1 -MD -DNDEBUG', gccversion=
    cppflags='-DWIN32'
    ccflags ='-O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT
-DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DPERL_MSVCRT_READFIX'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release
-libpath:"C:\opt\perl\lib\CORE"  -machine:x86'
    libpth="C:\Programme\Microsoft Visual Studio\VC98\mfc\lib"
"C:\Programme\Microsoft Visual Studio\VC98\lib" "C:\opt\perl\lib\CORE"
    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 wsock32.lib mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
-libpath:"C:\opt\perl\lib\CORE"  -machine:x86'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY

---
@INC for perl v5.6.0:
    c:/usr/perl
    C:/opt/perl/lib
    C:/opt/perl/site/lib
    .

---
Environment for perl v5.6.0:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
 
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\WBEM;C:\Programme\Reso
urce Pro Kit\;C:\Programme\Win2k Support
Tools\;C:\PROGRA~1\SHELLC~1;C:\PROGRA~1\ULTRAE~1;C:\Programme\Rational\c
ommon;c:\opt\bin;c:\opt\mysql3.23.39a\bin;C:\opt\apache\bin;C:\opt\perl\
bin;C:\opt\Python\;C:\Programme\Network
Associates\PGPNT;C:\Programme\Microsoft Visual
Studio\Common\Tools\WinNT;C:\Programme\Microsoft Visual
Studio\Common\MSDev98\Bin;C:\Programme\Microsoft Visual
Studio\Common\Tools;C:\Programme\Microsoft Visual
Studio\VC98\bin;C:\opt\cygwin\bin;c:\opt\perltidy\perltidy-20010617
    PERL5LIB=c:/usr/perl
    PERL_BADLANG (unset)
    SHELL (unset)





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