Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global used where lexical was expected #4820

Closed
p5pRT opened this issue Jan 13, 2002 · 3 comments
Closed

global used where lexical was expected #4820

p5pRT opened this issue Jan 13, 2002 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 13, 2002

Migrated from rt.perl.org#8225 (status was 'resolved')

Searchable as RT8225$

@p5pRT
Copy link
Author

p5pRT commented Jan 13, 2002

From jefpin@towers.crusoe.net

Created by jefpin@towers.crusoe.net

Perl is using the global $x where I expected it to use the lexical
$x instead.

  jefpin@​towers [10​:36am] ~ #219> bleadperl
  $x = "THIS";
  my $x = "THAT";
  print "${x} ${x}[2]\n";
  __END__
  THAT THIS[2]

It has to do with the fact that the next character is "[" or "{".

And when I introduce a lexically-scoped @​x, then "${x}[2]" is rendered
as just "[2]".

  jefpin@​towers [10​:36am] ~ #219> bleadperl
  $x = "THIS";
  my $x = "THAT";
  my @​x = (1..5);
  print "${x} ${x}[2]\n";
  __END__
  THAT [2]

This does not feel right to me. Perhaps this is a case of one of those
weighting mechanisms (where Perl decides what to render a variable-type
thing as) failing?

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.7.2:

Configured by jefpin at Sun Jan  6 01:49:30 EST 2002.

Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 14101) configuration:
  Platform:
    osname=linux, osvers=2.2.16-3, archname=i586-linux
    uname='linux towers.crusoe.net 2.2.16-3 #5 sat jul 8 11:42:18 edt 2000 i586 unknown '
    config_args='-DDEBUGGING -Dusedevel -Dprefix=/tmp/bleadperl -de'
    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=define
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing'
    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, 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:
    DEVEL14041


@INC for perl v5.7.2:
    /tmp/bleadperl/lib/5.7.2/i586-linux
    /tmp/bleadperl/lib/5.7.2
    /tmp/bleadperl/lib/site_perl/5.7.2/i586-linux
    /tmp/bleadperl/lib/site_perl/5.7.2
    /tmp/bleadperl/lib/site_perl
    .


Environment for perl v5.7.2:
    HOME=/home/jefpin
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/home/jefpin/bin:/tmp/bleadperl/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


@p5pRT
Copy link
Author

p5pRT commented Jul 6, 2003

From @iabyn

(Just reviewing old Perl bugs).

This appears to be fixed in bleedperl by patch #18753, and in 5.8.1-tobe
by patch #18783.

Regards,

Dave M.

@p5pRT
Copy link
Author

p5pRT commented Jul 6, 2003

@iabyn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant