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

nested sort in perl-5.7.0 fails #4049

Closed
p5pRT opened this issue May 30, 2001 · 5 comments
Closed

nested sort in perl-5.7.0 fails #4049

p5pRT opened this issue May 30, 2001 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented May 30, 2001

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

Searchable as RT7063$

@p5pRT
Copy link
Author

p5pRT commented May 30, 2001

From js@delphi.kpnqwest.fi

Code​:

  #!/usr/bin/perl -w

  use strict;
  my @​x = sort { X​::foo($a) cmp X​::foo($b) } qw(FOO BAR);

  package X;
  sub foo {
  my $arg = shift;
  my @​dummy = sort { $arg.$a cmp $arg.$b } qw(B A);
  print "$arg @​dummy\n";
  return $arg;
  }

Expected output is, AFAICS, that kind of lines (in some order)​:

  FOO A B
  BAR A B

However, this is what I got in my perl-5.7.0​:

  FOO A B
  Use of uninitialized value in concatenation (.) or string at ./foo.pl line 9.
  Use of uninitialized value in concatenation (.) or string at ./foo.pl line 9.
  BAR B A

and I've heard that perl-5.7.1 outputs​:

  FOO A B
  BAR B A

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl v5.7.0:

Configured by js at Fri Jan 26 20:09:22 EET 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.7, archname=sun4-solaris
    uname='sunos delphi 5.7 generic_106541-10 sun4u sparc sunw,ultra-250 '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-I/usr/local/include', optimize='-xO4', cppflags='-I/usr/local/include'
    ccversion='WorkShop Compilers 5.0 98/12/15 C 5.0', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib -L/opt/SUNWspro/SC5.0/lib'
    libpth=/usr/local/lib /opt/SUNWspro/SC5.0/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib -L/opt/SUNWspro/SC5.0/lib'

Locally applied patches:
    


@INC for perl v5.7.0:
    /home/js
    /usr/local/perl-5.7.0/lib/5.7.0/sun4-solaris
    /usr/local/perl-5.7.0/lib/5.7.0
    /usr/local/perl-5.7.0/lib/site_perl/5.7.0/sun4-solaris
    /usr/local/perl-5.7.0/lib/site_perl/5.7.0
    /usr/local/perl-5.7.0/lib/site_perl
    .


Environment for perl v5.7.0:
    HOME=/home/js
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/oracle/app/product/8.0.6/lib:/usr/openwin/lib
    LOGDIR (unset)
    PATH=/home/js/bin:/oracle/app/product/8.0.6/bin:/opt/SUNWspro/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ccs/bin:/usr/local/bin:/usr/local/sbin:/usr/X/bin
    PERL5LIB=/home/js
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/zsh

@p5pRT
Copy link
Author

p5pRT commented May 9, 2003

From @iabyn

still exists in bleeperl@​19435​:

[19435]$ ./perl -Ilib /tmp/p
FOO A B
Use of uninitialized value in concatenation (.) or string at /tmp/p line 13.
Use of uninitialized value in concatenation (.) or string at /tmp/p line 13.
BAR B A

@p5pRT
Copy link
Author

p5pRT commented Dec 14, 2005

From @smpeters

[davem - Thu May 08 17​:36​:31 2003]​:

still exists in bleeperl@​19435​:

[19435]$ ./perl -Ilib /tmp/p
FOO A B
Use of uninitialized value in concatenation (.) or string at /tmp/p
line 13.
Use of uninitialized value in concatenation (.) or string at /tmp/p
line 13.
BAR B A

Appears to be fixed with patch included with 36430.

steve@​kirk​:~/perl-current$ ./perl -Ilib rt_7063.pl
FOO A B
BAR A B

@p5pRT
Copy link
Author

p5pRT commented Dec 15, 2005

From @smpeters

[stmpeters - Wed Dec 14 11​:55​:23 2005]​:

[davem - Thu May 08 17​:36​:31 2003]​:

still exists in bleeperl@​19435​:

[19435]$ ./perl -Ilib /tmp/p
FOO A B
Use of uninitialized value in concatenation (.) or string at /tmp/p
line 13.
Use of uninitialized value in concatenation (.) or string at /tmp/p
line 13.
BAR B A

Appears to be fixed with patch included with 36430.

steve@​kirk​:~/perl-current$ ./perl -Ilib rt_7063.pl
FOO A B
BAR A B

Actually fixed with change #25953.

@p5pRT p5pRT closed this as completed Dec 15, 2005
@p5pRT
Copy link
Author

p5pRT commented Dec 15, 2005

@smpeters - 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