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

filetest pragma causes extraneous output #4949

Closed
p5pRT opened this issue Feb 3, 2002 · 2 comments
Closed

filetest pragma causes extraneous output #4949

p5pRT opened this issue Feb 3, 2002 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 3, 2002

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

Searchable as RT8401$

@p5pRT
Copy link
Author

p5pRT commented Feb 3, 2002

From trey@sage.org

Created by harris@localhost.localdomain

Given the following code​:

#!/usr/bin/perl -v
use filetest 'access';

foreach (@​ARGV) {
  print("Can", -x $_ ? "" : " NOT", " execute $_.\n");
}
__END__

The filename being tested is printed at the point of filetest, i.e.
"Canfoo NOT execute foo.". This is only true when the filetest pragma is
in effect. Comment the pragma, so that stat() rather than access() is
used for filetests, and the output is as expected, i.e. "Can execute foo."
or "Can NOT execute foo.".

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl v5.7.0:

Configured by harris at Mon Apr 16 18:56:21 EDT 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.17-21mdk, archname=i386-linux
    uname='linux localhost.localdomain 2.2.17-21mdk #1 thu oct 5 13:16:08 cest 2000 i686 unknown '
    config_args='-des -Darchname=i386-linux -Dd_dosuid -Ud_csh -Duseshrplib -Doptimize=-O3 -fomit-frame-pointer -pipe -s -mcpu=pentiumpro -march=pentiumpro -ffast-math -fexpensive-optimizations -Dprefix=/usr -Dusedevel -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/lib/perl5/man/man3'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O3 -fomit-frame-pointer -pipe -s -mcpu=pentiumpro -march=pentiumpro -ffast-math -fexpensive-optimizations', cppflags='-fno-strict-aliasing'
    ccversion='', gccversion='2.95.3 19991030 (prerelease)', 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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil
    libc=/lib/libc-2.1.3.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.7.0/i386-linux/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.7.0:
    /usr/lib/perl5/5.7.0/i386-linux
    /usr/lib/perl5/5.7.0
    /usr/lib/perl5/site_perl/5.7.0/i386-linux
    /usr/lib/perl5/site_perl/5.7.0
    /usr/lib/perl5/site_perl/5.6.0/i386-linux
    /usr/lib/perl5/site_perl/5.6.0
    /usr/lib/perl5/site_perl/5.005/i386-linux
    /usr/lib/perl5/site_perl/5.005
    /usr/lib/perl5/site_perl
    .


Environment for perl v5.7.0:
    HOME=/home/harris
    LANG=en
    LANGUAGE=en_US:en
    LC_COLLATE=en_US
    LC_CTYPE=en_US
    LC_MESSAGES=en_US
    LC_MONETARY=en_US
    LC_NUMERIC=en_US
    LC_TIME=en_US
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/usr/X11R6/bin:/usr/games:/home/harris/bin:/usr/X11R6/bin:/usr/games:/usr/X11R6/bin:/usr/games:/home/harris/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash



@p5pRT
Copy link
Author

p5pRT commented Feb 4, 2002

From @rgarcia

On 2002.02.03 16​:42 Trey Harris wrote​:

Given the following code​:

#!/usr/bin/perl -v
use filetest 'access';

foreach (@​ARGV) {
print("Can", -x $_ ? "" : " NOT", " execute $_.\n");
}
__END__

The filename being tested is printed at the point of filetest, i.e.
"Canfoo NOT execute foo.". This is only true when the filetest pragma is
in effect. Comment the pragma, so that stat() rather than access() is
used for filetests, and the output is as expected, i.e. "Can execute foo."
or "Can NOT execute foo.".

The latest bleadperl gives me the correct answer​: "Can NOT execute foo",
so it appears that this bug will be fixed in the next perl releases.

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