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

setting $handle->input_record_separator changes global $/ #1089

Closed
p5pRT opened this issue Jan 26, 2000 · 3 comments
Closed

setting $handle->input_record_separator changes global $/ #1089

p5pRT opened this issue Jan 26, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 26, 2000

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

Searchable as RT2042$

@p5pRT
Copy link
Author

p5pRT commented Jan 26, 2000

From arjen.bax@cmg.nl


Calling $handle->input_record_separator(undef) for an object of type
FileHandle seems to change the global i.r.s. $/, causing subsequently
opened files to be opened in "slurp" mode.

This bug was previously reported in 1997 (see
http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1997-11/msg01170.html
), but I couldn't find any record that it was solved.



Site configuration information for perl 5.00503​:

Configured by gwingerde at Sat Jan 15 23​:59​:29 MET 2000.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration​:
  Platform​:
  osname=dec_osf, osvers=4.0, archname=alpha-dec_osf
  uname='osf1 wsbdev2 v4.0 1229 alpha '
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef useperlio=undef d_sfio=undef
  Compiler​:
  cc='cc', optimize='-O4', gccversion=
  cppflags='-std -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C'
  ccflags ='-std -fprm d -ieee -D_INTRINSICS -I/usr/local/include
-DLANGUAGE_C'
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=8, ptrsize=8, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
  alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries​:
  ld='ld', ldflags ='-Wl,-oldstyle_liblookup -L/usr/local/lib'
  libpth=/usr/local/lib /usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc
/usr/lib /var/shlib
  libs=-ldbm -ldb -lm
  libc=/usr/shlib/libc.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
-Wl,-rpath,/usr/local/lib/perl5/5.00503/alpha-dec_osf/CORE'
  cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym -s
-L/usr/local/lib'

Locally applied patches​:
 


@​INC for perl 5.00503​:
  /usr/local/lib/perl5/5.00503/alpha-dec_osf
  /usr/local/lib/perl5/5.00503
  /usr/local/lib/perl5/site_perl/5.005/alpha-dec_osf
  /usr/local/lib/perl5/site_perl/5.005
  .


Environment for perl 5.00503​:
  HOME=/home/abax
  LANG (unset)
  LANGUAGE (unset)

LD_LIBRARY_PATH=/home/abax/wap/lib​:/home/abax/wap/lib​:/usr/local/w3c-libwww/
lib​:/usr/local/lib​:/usr/lib​:/lib
  LOGDIR (unset)

PATH=/usr/local/bin/gvim​:/home/abax/wap/bin​:/home/abax/wap/bin​:/usr/local/bi
n​:/usr/bin​:/bin​:/usr/sbin​:/sbin​:.
  PERL_BADLANG (unset)
  SHELL=/usr/bin/ksh

@p5pRT
Copy link
Author

p5pRT commented Jan 26, 2000

From [Unknown Contact. See original ticket]

Arjen Bax writes​:
| Calling $handle->input_record_separator(undef) for an object of type
| FileHandle seems to change the global i.r.s. $/, causing subsequently
| opened files to be opened in "slurp" mode.
|
| This bug was previously reported in 1997 (see
| http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1997-11/msg01170.html
| ), but I couldn't find any record that it was solved.

Because it's not a bug.

1) You're using a FileHandle.

From the FileHandle manpage​:

  NOTE​: This class is now a front\-end to the IO​::\* classes\.

From the IO​::Handle manpage​:

  The following methods are not supported on a per\-filehandle basis\.
      IO​::Handle\->input\_record\_separator\( \[STR\] \)       $/

The manual is fine. Please read it.

Mx.

@p5pRT
Copy link
Author

p5pRT commented Jan 26, 2000

From [Unknown Contact. See original ticket]

Martyn Pearce, thank you very much for the prompt answer to my question!
My apologies for asking a question on this mailing list instead
of reading an up-to-date manual. I'm using the HTML-version of the
manual that comes with ActivePerl 5.005_03 built for MSWin32-x86-object,
and the man page for IO​::Handle does not mention the limitation that
some methods aren't supported on a per-handle basis. It merely says​:

"See perlvar for complete descriptions of each of the following
supported IO​::Handle methods​:

  autoflush
  output_field_separator
  output_record_separator
  input_record_separator
  input_line_number
  ..."

So I think I'll have to download a newer version of the manual
(and read it, of course!).

Bye,

--
Arjen Bax
CMG Noord-Nederland BV
Divisie Advanced Technology
Postbus 70237
9704 AE Groningen
Tel​: +31-50-5219500, fax​: +31-50-5219503

This message is transmitted on 100% recycled electrons.

-----Original Message-----
From​: Martyn Pearce [mailto​:martyn@​inpharmatica.co.uk]
Sent​: Wednesday, January 26, 2000 1​:23 PM
To​: Arjen Bax
Cc​: perl5-porters@​perl.org; Gertjan van Wingerde; Steef Vogelsang
Subject​: [ID 20000126.002] setting $handle->input_record_separator
changes global $/

Arjen Bax writes​:
| Calling $handle->input_record_separator(undef) for an object of type
| FileHandle seems to change the global i.r.s. $/, causing
subsequently
| opened files to be opened in "slurp" mode.
|
| This bug was previously reported in 1997 (see
|
http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1997-11
/msg01170.html
| ), but I couldn't find any record that it was solved.

Because it's not a bug.

1) You're using a FileHandle.

From the FileHandle manpage​:

  NOTE​: This class is now a front\-end to the IO​::\* classes\.

From the IO​::Handle manpage​:

  The following methods are not supported on a per\-filehandle basis\.
      IO​::Handle\->input\_record\_separator\( \[STR\] \)       $/

The manual is fine. Please read it.

Mx.

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