develooper Front page | perl.perl5.porters | Postings from January 2001

[ID 20010118.023] probem with while loop when $/ is assigned to undef

From:
dinab
Date:
January 18, 2001 04:42
Subject:
[ID 20010118.023] probem with while loop when $/ is assigned to undef
Message ID:
E14JENu-00030U-00@adam.il.inlumen.com
This is a bug report for perl from dbayvelman@inlumen.com,
generated with the help of perlbug 1.28 running under perl v5.6.0.


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

if $/ is set to undef and using while loop for reading the file, than file will be read twice. This happens in perl5.6.            
It may be used for generic reason, that is to say on differant events to assign differant values to $/ 

For instance:
$/ = $undef;
while (<F>)
{
	print "$_\n";
}
#if $/ was undef, than 'print' will be called twice: first it will print out whole file and second time empty string.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.6.0:

Configured by jklein at Thu Apr  6 16:50:54 IST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos genesis 5.5.1 generic_103640-26 sun4u sparc sunw,ultra-5_10 '
    config_args='-de -Dprefix=/usr/local/perl5.6 -Dinstallusrbinperl=undef'
    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='cc', optimize='-O', gccversion=
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include '
    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=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib -L/opt/gnu/lib '
    libpth=/usr/local/lib /opt/gnu/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt -lsec
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib -L/opt/gnu/lib'

Locally applied patches:
    

---
@INC for perl v5.6.0:
    /usr/local/perl5.6/lib/5.6.0/sun4-solaris
    /usr/local/perl5.6/lib/5.6.0
    /usr/local/perl5.6/lib/site_perl/5.6.0/sun4-solaris
    /usr/local/perl5.6/lib/site_perl/5.6.0
    /usr/local/perl5.6/lib/site_perl
    .

---
Environment for perl v5.6.0:
    HOME=/home/dinab
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/opt/SUNWmotif/lib:/usr/openwin/lib:/proj/triarch/ssl/lib:/usr/local/lib:/opt/newsdev/lib:/opt/newsdev/sun7/lib:/opt/hpnp/lib
    LOGDIR (unset)
    PATH=/home/dinab/bin:/usr/local/bin:/usr/local/etc:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/opt/SUNWmotif/bin:/usr/openwin/bin:/usr/openwin/demo:/usr/bin/X11:/opt/SUNWspro/bin:/usr/ucb:/etc:/usr/etc:/usr/hosts:/usr/lang:/bin:/usr/bin:/usr/5bin:/usr/snm/bin:/usr/local/frame/bin:/home/ddts/bin:/opt/gnu/bin:/export2/oracle8/product/8.0.5/bin:/websrc/vmenv/tools:/opt/newsdev/bin:/opt/newsdev/sun7/bin:/opt/news/bin:/opt/hpnp/bin:.
    PERL_BADLANG (unset)
    SHELL=/bin/ksh




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About