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

assigning to chomp() with filehandle read #3587

Closed
p5pRT opened this issue Mar 19, 2001 · 3 comments
Closed

assigning to chomp() with filehandle read #3587

p5pRT opened this issue Mar 19, 2001 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 19, 2001

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

Searchable as RT6139$

@p5pRT
Copy link
Author

p5pRT commented Mar 19, 2001

From @tamias

Usually, assigning to chomp yields a compile-time error​:

  % perl -ce ' chomp( $x = 4 ) = 7 '
  Can't modify scalar chomp in scalar assignment at -e line 1, at EOF
  -e had compilation errors.

However, if the argument to chomp includes an assignment from a filehandle
read, the code compiles successfully​:

  % perl -ce ' chomp( $x = <> ) = 7 '
  -e syntax OK

I'm wondering if perhaps the filehandle read confuses perl into thinking
this is a list chomp, which apparently can be assigned to without error​:

  % perl -ce ' chomp( @​x ) = 7 '
  -e syntax OK

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl v5.6.0:

Configured by rjk at Mon Aug 14 15:24:32 EDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.12-32smp, archname=i686-linux
    uname='linux herschel.focalex.com 2.2.12-32smp #1 smp mon oct 25 19:50:48 edt 1999 i686 unknown '
    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='cc', optimize='-g', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    cppflags='-fno-strict-aliasing'
    ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DDEBUGGING'
    stdchar='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=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 -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=/lib/libc-2.1.2.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.6.0:
    /home/rjk/perl/lib/5.6.0/i686-linux
    /home/rjk/perl/lib/5.6.0
    /home/rjk/perl/lib/site_perl/5.6.0/i686-linux
    /home/rjk/perl/lib/site_perl/5.6.0
    /home/rjk/perl/lib/site_perl
    .


Environment for perl v5.6.0:
    HOME=/home/rjk
    LANG=en_US
    LANGUAGE (unset)
    LC_ALL=en_US
    LD_LIBRARY_PATH=/u01/app/oracle/product/8.0.5/lib
    LOGDIR (unset)
    PATH=/usr/local/bin:/bin:/usr/bin::/usr/X11R6/bin:/home/rjk/bin:/usr/sbin:/usr/local/bin:/u01/app/oracle/product/8.0.5/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented May 8, 2003

From @iabyn

(Just reviewing old perl bug reports).

this has been fixed in the latest development version of Perl, which
will eventually be relased at 5.10.0.

Regards,

Dave M.

@p5pRT
Copy link
Author

p5pRT commented May 8, 2003

@iabyn - Status changed from 'open' to 'resolved'

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