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

Effect of interpolating glob undef #2149

Closed
p5pRT opened this issue Jun 29, 2000 · 3 comments
Closed

Effect of interpolating glob undef #2149

p5pRT opened this issue Jun 29, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 29, 2000

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

Searchable as RT3443$

@p5pRT
Copy link
Author

p5pRT commented Jun 29, 2000

From mihelich@fas.harvard.edu

Created by mihelich@fas.harvard.edu

Logically, the expression glob undef should return a trivial value
(undef or a null string). If I run the script

$a = glob undef;
print "Glob undef ($a).\n";
print "Glob undef ($ {\ (glob undef)}).\n";

I get the following output​:

Glob undef ().
Glob undef (Glob undef ().

Thus glob undef is null if simply assigned to a variable, but if it is
interpolated into a double-quotish string, it equals the substring
preceding it. I cannot invent a reason why this behavior should be
construed as correct.

___________________________________________________________________
Chris Mihelich The time is gone; the song is over;
mihelich@​fas.harvard.edu thought I'd something more to say.
June 29, 2000 09​:41 EDT -- Pink Floyd, "Time"
-------------------------------------------------------------------

Perl Info


Site configuration information for perl 5.00401:

Configured by minnella at Sun Jul 13 19:53:05 EDT 1997.

Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration:
  Platform:
    osname=dec_osf, osvers=4.0, archname=alpha-dec_osf
    uname='osf1 acetone v4.0 564 alpha alpha '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio= d_sfio=
  Compiler:
    cc='cc', optimize='-O4', gccversion=
    cppflags='-std -D_INTRINSICS -I/usr/local/include -D__LANGUAGE_C__'
    ccflags ='-std -D_INTRINSICS -I/usr/local/include -D__LANGUAGE_C__'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/shlib /shlib /lib /usr/lib /usr/ccs/lib
    libs=-lgdbm -ldbm -ldb -lm
    libc=/usr/shlib/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
    cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym -s -L/usr/local/lib'



@INC for perl 5.00401:
	/usr/local/lib/perl5/alpha-dec_osf/5.00401
	/usr/local/lib/perl5
	/usr/local/lib/perl5/site_perl/alpha-dec_osf
	/usr/local/lib/perl5/site_perl
	.


Environment for perl 5.00401:
    HOME=/home/m/i/mihelich
    LANG (unset)
    LD_LIBRARY_PATH=/home/l/i/lib175/usr/lib
    LOGDIR (unset)
    PATH=/home/l/i/lib175/usr/bin:/home/m/i/mihelich:/usr/local/bin/X11:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:/usr/ucb:/usr/etc:/usr/ccs/bin:.
    PERL_BADLANG (unset)
    SHELL=/shells/tcsh



@p5pRT
Copy link
Author

p5pRT commented Jun 29, 2000

From [Unknown Contact. See original ticket]

Christopher Mihelich wrote​:

This is a bug report for perl from mihelich@​fas.harvard.edu,
generated with the help of perlbug 1.17 running under perl 5.00401.

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

Logically, the expression glob undef should return a trivial value
(undef or a null string). If I run the script

Looks good in perl-5.6.0 (see below), though the warnings are not as clear as
they could be. Any chance you can upgrade?

- Barrie

$ perl -w glob
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/5.6.0/i686-linux/File/Glob.pm line 130.
Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/5.6.0/i686-linux/File/Glob.pm line 148.
perl-5.006
Glob undef ().
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/5.6.0/i686-linux/File/Glob.pm line 130.
Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/5.6.0/i686-linux/File/Glob.pm line 148.
Glob undef ().
###############
glob​:
$a = glob undef;
print "perl-$]\n" ;
print "Glob undef ($a).\n";
print "Glob undef ($ {\ (glob undef)}).\n";

open F, $0 ; print "###############\n$0​:\n", <F> ;

@p5pRT
Copy link
Author

p5pRT commented Jun 29, 2000

From @tamias

On Thu, Jun 29, 2000 at 10​:46​:34AM -0400, Barrie Slaymaker wrote​:

Christopher Mihelich wrote​:

This is a bug report for perl from mihelich@​fas.harvard.edu,
generated with the help of perlbug 1.17 running under perl 5.00401.

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

Logically, the expression glob undef should return a trivial value
(undef or a null string). If I run the script

Looks good in perl-5.6.0 (see below), though the warnings are not as clear as
they could be. Any chance you can upgrade?

The behavior is correct in perl5.005_03 as well. It may also be correct in
a more recent 5.004. 5.004_01 is very old.

Ronald

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