Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.86k stars 528 forks source link

print \@foo=~/^ARRAY/?"yes\n":"no\n" changes behaviour in 5.6.0 #1798

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

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

Searchable as RT3057$

p5pRT commented 24 years ago

From smulcahy@ilo.dec.com

Created by stephen.mulcahy@compaq.com

The following codes behaviour has changed moving to 5.6.0. While accepting that ref is the correct way to do this\, is this change intentional or accidental?

$ perl5.6.0 -e 'print \@​foo=~/^ARRAY/?"yes\n"​:"no\n"' no $ perl5.00503 -e 'print \@​foo=~/^ARRAY/?"yes\n"​:"no\n"' yes

Note that the following both produce the same output

$ perl5.6.0 -e 'print \@​foo . "\n"' $ perl5.00503 -e 'print \@​foo . "\n"'

ARRAY(....)

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.6.0: Configured by smulcahy at Thu Mar 30 11:51:10 BST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=dec_osf, osvers=4.0, archname=alpha-dec_osf uname='osf1 fuse.ilo.dec.com v4.0 1091 alpha ' 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=define use64bitall=define uselongdouble=define usesocks=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 ivtype='long', ivsize=8, nvtype='long double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=n, prototype=define Linker and Libraries: ld='ld', ldflags =' -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 -liconv 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.6.0/alpha-dec_osf/CORE' cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym -std -s -L/usr/local/lib' Locally applied patches: @INC for perl v5.6.0: /usr/local/lib/perl5/5.6.0/alpha-dec_osf /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/alpha-dec_osf /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl/5.005/alpha-dec_osf /usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl . Environment for perl v5.6.0: HOME=/usr/users/smulcahy LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/users/smulcahy/ftp/vrweb/bin/scripts:/usr/local/bin:/usr/dt/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/netpbm:/usr/users/jquinn/povray3/include:/usr/users/jquinn/java:/bin:/usr/local/bin:/usr/ucb:/usr/bin:/usr/etc:/etc:/usr/games:/usr/bin/mh:/sbin:/usr/sbin:/usr/users/smulcahy/bin:/usr/users/smulcahy/bin/alpha-OSF1:/disk01/app/oracle/product/7.3.4/bin:/usr/local/enlightenment/bin PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

Stephen Mulcahy writes​:

The following codes behaviour has changed moving to 5.6.0.

Nope\, no change. Just a bug.

$ perl5.6.0 -e 'print \@​foo=~/^ARRAY/?"yes\n"​:"no\n"' no

I sent a patch a week or so ago.

Ilya