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

glob returns warning message in file name #823

p5pRT opened this issue Nov 6, 1999 · 1 comment

glob returns warning message in file name #823

p5pRT opened this issue Nov 6, 1999 · 1 comment


Copy link

p5pRT commented Nov 6, 1999

Migrated from (status was 'resolved')

Searchable as RT1751$

Copy link

p5pRT commented Nov 6, 1999


first of all​:

i have not actually verified this bug with perl v5.004.04.

i have verified it on perl v5.005.02 and v5.005.03.

SunOS 5.6, i believe.

"perl -v" on the machine i was using reports​:
This is perl, version 5.005_03 built for sun4-solaris


here is test program​:

#!/usr/local/bin/perl -w
use strict;
use diagnostics;

# this program will print weird warning message
# as part of first filename returned from "glob"
# if any directories above the one given are not
# readable by current user.

my $directory = $ARGV[0];
my $file_suffix = $ARGV[1];

print "directory = $directory\n";
print "file_suffix = $file_suffix\n\n";

print "executing chdir $directory...\n";
chdir $directory;
print "chdir executed.\n\n";

print "executing glob...\n";
my @​files = glob ('*' . $file_suffix);
print "glob executed.\n\n";

for my $file (@​files)
  print "filename = { $file }\n";

print "\n";


# end of test program

if i run the program (called like this​:


where i do not have read access to all directories above
SOME_DIRECTORY_NAME then the first filename returned by glob function
will have "Warning​: cannot determine current directory\n" as part of
(specifically, pre-pended to) the name.

To be clear​: It does *not* generate an error or warning.

Rather, the *text* of that warning message is *part* of the first
returned filename.

This seems pretty clearly wrong, ie a bug. It certainly "complicates"
dealing with the filenames returned by glob!

Hope this helps!
Thanks; perl is cool. :)


Perl Info

Site configuration information for perl 5.00404:

Configured by vic at Mon Jun 15 22:04:55 EDT 1998.

Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos 5.6 generic sun4m sparc sunw,sparcstation-20 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
    cc='gcc', optimize='-O', gccversion=2.8.1
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib'

Locally applied patches:

@INC for perl 5.00404:

Environment for perl 5.00404:
    LANG (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

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

No branches or pull requests

1 participant