develooper Front page | perl.perl5.porters | Postings from May 2003

[perl #22088] lexical in format (scoping bug?)

Thread Next
From:
Abe Timmerman
Date:
May 2, 2003 07:56
Subject:
[perl #22088] lexical in format (scoping bug?)
Message ID:
rt-22088-56486.4.45519838928661@bugs6.perl.org
# New Ticket Created by  Abe Timmerman 
# Please include the string:  [perl #22088]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22088 >


This is a bug report for perl from abeltje@fikkie.local,
generated with the help of perlbug 1.34 running under perl v5.9.0.


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

This fails for every perl I have installed (5.4.5, 5.5.3, 5.6.1, 5.8.0, 
blead):

#! /usr/bin/perl -w
use strict;
$SIG{__WARN__} = sub { die "@_" };

my %hash = ( key1 => 'value1', key2 => 'value2' );

my( $val1, $val2 );
format =
@>>>>> @<<<<<<<<<<
$val1, $val2
.

# This is ok
foreach $val1 ( keys %hash ) {
    $val2 = $hash{ $val1 };
    write;
}

print_hash();

# This isn't
sub print_hash {
    foreach $val1 ( keys %hash ) {
        $val2 = $hash{ $val1 };
        write;
    }
}
__END__


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

Configured by abeltje at Wed Apr  9 15:37:32 CEST 2003.

Summary of my perl5 (revision 5.0 version 9 subversion 0 patch 19172) 
configuration:
  Platform:
    osname=linux, osvers=2.4.18-4gb, archname=i686-linux
    uname='linux fikkie 2.4.18-4gb #1 wed mar 27 13:57:05 utc 2002 i686 
unknown '
    config_args='-des -Dusedevel -Dprefix=/opt/bleadperl'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=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 -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.3 20010315 (SuSE)', 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 -lndbm -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil -lrt
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil -lrt
    libc=, 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:
    DEVEL18374

---
@INC for perl v5.9.0:
    /opt/bleadperl/lib/5.9.0/i686-linux
    /opt/bleadperl/lib/5.9.0
    /opt/bleadperl/lib/site_perl/5.9.0/i686-linux
    /opt/bleadperl/lib/site_perl/5.9.0
    /opt/bleadperl/lib/site_perl
    .

---
Environment for perl v5.9.0:
    HOME=/home/abeltje
    LANG=en_US
    LANGUAGE (unset)
    LC_COLLATE=POSIX
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    
PATH=/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/opt/kde2/bin:/usr/lib/java/bin:/opt/gnome/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Good luck,

Abe
-- 
We might as well document that in future sort() in scalar context *may*
make flying pigs in pink tutus spring forth from one's nostrils, too :-)
For 5.8.0 I'm happy just to document the current behaviour.
                                   -- Jarkko Hietaniemi on p5p @ 2002-06-12



Thread Next


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