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

[ID 20001120.014] Scoping bug of %^H?

From:
Andreas J. Koenig
Date:
November 20, 2000 18:16
Subject:
[ID 20001120.014] Scoping bug of %^H?
Message ID:
200011210216.DAA27651@ak-71.mind.de

This is a bug report for perl from k@ak-71.mind.de,
generated with the help of perlbug 1.33 running under perl v5.7.0.


-----------------------------------------------------------------
[Please enter your report here]
Today I was interested in finding out how one is supposed to
use charnames.pm at runtime but then I stumbled over this example.

The following program works as expected and prints the same character
tree times in a row. I omit the output because it would be converted
to death anyway. Note that $F[1] contains the string
    OGHAM SPACE MARK
after the split().

% /usr/local/perl-5.7.0@7787/bin/perl -e '
use charnames qw(:full); 
@ARGV = grep -e, map "$_/unicode/Unicode.301", @INC;
LINE: while (<>){
 next unless /OGHAM/;
 chomp($_);
 @F = split /;/, $_, 0;
 use charnames qw(:full);
 my $evaled = eval(qq{"\\N{$F[1]}"});
 my $runtime = charnames::charnames($F[1]);
 printf "%s %s %s %s %s\n", chr(hex($F[0])), $evaled, $runtime, @F[0,1];
 last;
}
'

But if I comment out the first occurrence of 'use charnames', then
the program does not want to live:

% /usr/local/perl-5.7.0@7787/bin/perl -e '
# use charnames qw(:full);
@ARGV = grep -e, map "$_/unicode/Unicode.301", @INC;
LINE: while (<>){
 next unless /OGHAM/;
 chomp($_);
 @F = split /;/, $_, 0;
 use charnames qw(:full);
 my $evaled = eval(qq{"\\N{$F[1]}"});
 my $runtime = charnames::charnames($F[1]);
 printf "%s %s %s %s %s\n", chr(hex($F[0])), $evaled, $runtime, @F[0,1];
 last;
}
'
Unknown charname 'OGHAM SPACE MARK' at /usr/local/perl-5.7.0@7787/lib/5.7.0/charnames.pm line 32, <> line 4249.





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

Configured by k at Tue Nov 21 02:41:49 CET 2000.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.16a, archname=i686-linux
    uname='linux ak-71.mind.de 2.2.16a #1 smp wed jun 14 11:59:53 cest 2000 i686 unknown '
    config_args='-Dprefix=/usr/local/perl-5.7.0@7787 -Doptimize=-g -des -Duseperlio -Dusedevel'
    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
  Compiler:
    cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)', 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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil
    libc=/lib/libc-2.1.3.so, 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:
    DEVEL7776

---
@INC for perl v5.7.0:
    /usr/local/perl-5.7.0@7787/lib/5.7.0/i686-linux
    /usr/local/perl-5.7.0@7787/lib/5.7.0
    /usr/local/perl-5.7.0@7787/lib/site_perl/5.7.0/i686-linux
    /usr/local/perl-5.7.0@7787/lib/site_perl/5.7.0
    /usr/local/perl-5.7.0@7787/lib/site_perl
    .

---
Environment for perl v5.7.0:
    HOME=/home/k
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/k/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/perl/bin:/usr/X11/bin:/sbin:/usr/sbin:/usr/local/Office51/bin
    PERL_BADLANG (unset)
    SHELL=/bin/zsh




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