Perl / perl5

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

map modifies input #196

Closed p5pRT closed 21 years ago

p5pRT commented 25 years ago

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

Searchable as RT1002$

p5pRT commented 25 years ago

From jjgreen@cisco.com

This doesn't work like I would expect​:

#!/usr/local/bin/perl -w my $aref = (); die if defined $aref; my @​list = map { $_ } @​{ $aref }; die if defined $aref;

Gives​:

Died at - line 4.

Running the script under the debugger\, it appears that after line 3 is complete\, $aref = [];


Site configuration information for perl 5.00502​:

Configured by rnapier at Wed Oct 28 11​:40​:57 EST 1998.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration​:   Platform​:   osname=solaris\, osvers=2.5.1\, archname=sun4-solaris-thread   uname='sunos tako 5.5.1 generic_103640-14 sun4d sparc sunw\,sparccenter-2000 '   hint=recommended\, useposix=true\, d_sigaction=define   usethreads=define useperlio=undef d_sfio=undef   Compiler​:   cc='gcc -B/usr/ccs/bin/'\, optimize='-O'\, gccversion=2.7-97r1   cppflags='-D_REENTRANT -I/usr/local/include'   ccflags ='-D_REENTRANT -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   alignbytes=8\, usemymalloc=y\, prototype=define   Linker and Libraries​:   ld='gcc -B/usr/ccs/bin/'\, ldflags =' -L/usr/local/lib'   libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib   libs=-lsocket -lnsl -ldl -lm -lposix4 -lpthread -lc -lcrypt   libc=\, so=so\, useshrplib=false\, libperl=libperl.a   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags='-fPIC'\, lddlflags='-G -L/usr/local/lib'

Locally applied patches​:  


@​INC for perl 5.00502​:   /users/rnapier/lib/perl5/5.00502/sun4-solaris-thread   /users/rnapier/lib/perl5/5.00502   /users/rnapier/lib/perl5/site_perl/5.005/sun4-solaris-thread   /users/rnapier/lib/perl5/site_perl/5.005   .


Environment for perl 5.00502​:   HOME=/users/jjgreen   LANG=C   LD_LIBRARY_PATH=/users/rnapier/lib​:/users/jjgreen/lib​:/usr/lib/X11​:/usr/openwin/lib   LOGDIR (unset)   PATH=/router/bin​:/usr/ucb​:/nfs/sw/current/solaris2bin​:/usr/atria/bin​:/users/rnapier/bin​:/users/jjgreen/bin​:/usr/local/bin​:/usr/local/etc​:/usr/dt/bin​:/usr/openwin/bin​:/usr/openwin/bin/xview​:/usr/frame/bin​:/usr/bin​:/usr/sbin​:/usr/5bin​:/usr/etc​:/bin​:/usr/ccs/bin​:/nfs/ddts/ddtshome/bin​:/sw/contrib/solaris2bin   PERL_BADLANG (unset)   SHELL=/usr/local/bin/tcsh

p5pRT commented 21 years ago

From @cwest

This is not a bug. Perl auto-vivifies and that's a Good Thing.

p5pRT commented 21 years ago

@cwest - Status changed from 'stalled' to 'resolved'