Phoenix.pm: [perlbug-followup@perl.org: [perl #24652] tieing stashes]

Scott Walters scott at illogics.org
Sat Dec 13 10:31:37 CST 2003


Some times people submit really interesting bugs that trigger discussion of
new features. No one wants to add entirely new features to Perl 5 but the 
Perl 5 Porters are always eager to make existing things work together in
more ways. There is serious discussion right now of having stashes
(symbol tables) be tieable so you can programaticly handle attempts
to define subroutines, local variables, our variables, or assign to
local or our variables. Heh.

-scott

----- Forwarded message from "kstar @ verizon. net Tassilo v.Parseval (via RT)" <perlbug-followup at perl.org> -----

Originator: tassilo.parseval at post.rwth-aachen.de
post: <mailto:perl5-porters at perl.org>
Archive: <http://nntp.perl.org/group/perl.perl5.porters/86237>
Received: from onion.perl.org (onion.develooper.com [63.251.223.166]) (qmail 43961 invoked by uid 1005); 13 Dec 2003 05:25:39 -0000 (qmail 43943 invoked by uid 76); 13 Dec 2003 05:25:39 -0000
Subject: [perl #24652] tieing stashes 
Spam-Is-Higher-Than: 5
Date: Sat, 13 Dec 2003 00:24:58 -0500 Fri Dec 12 14:51:09 2003 12 Dec 2003 19:50:04 -0000
To: mailing list perl5-porters at perl.org perl5-porters at perl.org perl5-porters at perl.org bugs-bitbucket at netlabs.develooper.com perl5-porters at perl.org perl5-porters at perl.org <rt-24652 at perl>
From: kstar at verizon.net "Tassilo v.Parseval (via RT)" <perlbug-followup at perl.org>


# New Ticket Created by  Tassilo v. Parseval 
# Please include the string:  [perl #24652]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=24652 >



This is a bug report for perl from tassilo.parseval at post.rwth-aachen.de,
generated with the help of perlbug 1.34 running under perl v5.8.2.


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

I noticed that perl wont stop you from tieing a stash:

ethan at ethan:~$ perl5.8.2 -MTie::Hash -MPOSIX=_exit -e 'tie %:: => "Tie::StdHash"; _exit(1)'
ethan at ethan:~$

When a proper shutdown via END happens, a seemingly unrelated message appears:

ethan at ethan:~$ perl5.8.2 -MTie::Hash -e 'tie %:: => "Tie::StdHash"'
Can't upgrade that kind of scalar during global destruction.
ethan at ethan:~$

Should these ties make perl croak when they happen? I can't yet see what
they could be used for especially since various perl versions behave very
differently here. Putting the tie() into a BEGIN block is a particularly
interesting experiment since functions defined in the thusly tied namespace
can't be hooked into the package any longer:
    
    ethan at ethan:~$ perl5.8.2 -MTie::Hash
    BEGIN { tie %:: => "Tie::StdHash"; }
    sub test {1}
    Can't upgrade that kind of scalar at - line 2.
    ^D
    Can't upgrade that kind of scalar during global destruction.

Also not bad:

    ethan at ethan:~$ perl5.8.2 -MTie::Hash
    BEGIN { tie %:: => "Tie::StdHash"; }
    sub test;
    Runaway prototype at - line 2.
    ^D
    Can't upgrade that kind of scalar during global destruction.

Tassilo

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

Configured by root at Fri Nov 14 07:29:04 UTC 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
  Platform:
    osname=linux, osvers=2.4.21, archname=i686-linux
    uname='linux ethan 2.4.21 #3 tue nov 11 09:22:00 utc 2003 i686 unknown '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 -march=athlon -fomit-frame-pointer -foptimize-sibling-calls -finline-functions -fstrength-reduce -frerun-loop-opt -fexpensive-optimizations -fprefetch-loop-arrays -fmove-all-movables',
    cppflags='-fno-strict-aliasing'
    ccversion='', gccversion='3.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.2.5'
  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.8.2:
    /usr/opt/perl5.8.2/lib/5.8.2/i686-linux
    /usr/opt/perl5.8.2/lib/5.8.2
    /usr/opt/perl5.8.2/lib/site_perl/5.8.2/i686-linux
    /usr/opt/perl5.8.2/lib/site_perl/5.8.2
    /usr/opt/perl5.8.2/lib/site_perl
    .

---
Environment for perl v5.8.2:
    HOME=/home/ethan
    LANG=C
    LANGUAGE (unset)
    LC_CTYPE=de_DE at euro
    LD_LIBRARY_PATH=:/usr/local/j2sdk1.4.0/jre/lib/i386:/usr/local/pwlib/lib:/usr/local/lib
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/local/j2re1.4.1/bin:/usr/local/mpich-1.2.5/ch_p4/bin
    PERLDOC_PAGER=/bin/less -isR
    PERL_BADLANG (unset)
    SHELL=/bin/bash

----- End forwarded message -----



More information about the Phoenix-pm mailing list