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

when $/ is undef, <> reads past EOF #2205

Closed
p5pRT opened this issue Jul 14, 2000 · 2 comments
Closed

when $/ is undef, <> reads past EOF #2205

p5pRT opened this issue Jul 14, 2000 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 14, 2000

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

Searchable as RT3504$

@p5pRT
Copy link
Author

p5pRT commented Jul 14, 2000

From bod@compusol.com.au


When $/ is not defined, <> reads past EOF​:

  $ perl -0777ne 'print $ARGV, "​: ", length, "\n"' /etc/group
  /etc/group​: 191
  /etc/group​: 0
  $

Some trace output.

  $ truss -topen,read perl -0777ne '[...]' /etc/group
  [...]
  open("/etc/group", O_RDONLY, 0666) = 3
  read(3, " r o o t : : 0 : r o o t".., 8192) = 191
  read(3, 0x08063008, 8192) = 0
  /etc/group​: 191
  read(3, 0x08063008, 8192) = 0
  /etc/group​: 0
  read(3, 0x08063008, 8192) = 0
  $

This behaviour does not appear to be specific to ARGV, as similar
behaviour is exhibited by​:

  #!/usr/bin/perl
  undef $/;
  open G, '/etc/group';
  while (<G>) { print length, "\n" }
  __END__



Flags​:
  category=core
  severity=medium


Site configuration information for perl v5.6.0​:

Configured by bod at Fri Mar 24 11​:47​:21 EST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration​:
  Platform​:
  osname=svr4, osvers=, archname=pentium-svr4
  uname='unix_system_v diablo 4.0 2 pentium p5eisa '
  config_args=''
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=undef d_sfio=undef uselargefiles=define
  use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler​:
  cc='/usr/local/bin/gcc', optimize='-O2', gccversion=2.8.0
  cppflags=''
  ccflags =''
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
  alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries​:
  ld='/usr/local/bin/gcc', ldflags =''
  libpth=/usr/local/lib /usr/lib /usr/ccs/lib
  libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -ldes -lc -ldbm
  libc=, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-fPIC', lddlflags='-shared'

Locally applied patches​:
 


@​INC for perl v5.6.0​:
  /usr/local/lib/perl5/5.6.0/pentium-svr4
  /usr/local/lib/perl5/5.6.0
  /usr/local/lib/perl5/site_perl/5.6.0/pentium-svr4
  /usr/local/lib/perl5/site_perl/5.6.0
  /usr/local/lib/perl5/site_perl
  .


Environment for perl v5.6.0​:
  HOME=/home/bod
  LANG (unset)
  LANGUAGE (unset)
  LC_CTYPE=en_AU
  LD_LIBRARY_PATH=/usr/local/lib​:/usr/X11R6/lib
  LOGDIR (unset)
  PATH=/home/bod/bin​:/usr/local/bin​:/usr/bin​:/usr/ucb​:/usr/X11R6/bin​:/home/venture/bin​:
  PERL_BADLANG (unset)
  SHELL=/bin/ksh

@p5pRT
Copy link
Author

p5pRT commented Jul 14, 2000

From [Unknown Contact. See original ticket]

"Brendan O'Dea" <bod@​compusol.com.au> wrote

When $/ is not defined, <> reads past EOF​:

This a known bug [ID 20000627.003], which has been fixed in the
development version, so should be mended in perl5.6.1.

If you can't wait for perl5.6.1, you can find the patch at

http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-06/msg00751.html

Mike Guy

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