Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!oscsunb!comeau From: comeau@osc.edu (Don Comeau) Newsgroups: comp.lang.perl Subject: Change $#array Message-ID: <217@oscsunb.osc.edu> Date: 25 Feb 90 21:04:38 GMT Organization: Ohio SuperComputer Center, Columbus, OH, USA Lines: 23 I'm running Perl 3.0 pl 8 on Sun-3s. The following script produces the unexpected output -1. #!/usr/hydrogen/gnu/bin/perl @array = (0,1,2,3,4,5,6); # $#array; # uncomment this line for expected behaviour $#array -= 2; print "elements in array -- ",$#array,"\n"; If the indicated line is uncommented, the script behaves as expected. Feel free to let me know if I'm doing something stupid or I had my eyes closed while reading the manual. Don Comeau comeau@hydrogen.mps.ohio-state.edu Dept of Chemistry comeau@ohstpy.bitnet Ohio State University 614-292-9431 -- Don Comeau comeau@osc.edu Ohio Supercomputer Center doncmh@ohstpy.bitnet 1224 Kinnear Road 614-292-6038 Columbus OH 43212-1154