Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!hplabs!hpcc05!hpcc01!weisberg From: weisberg@hpcc01.HP.COM (Len Weisberg) Newsgroups: comp.lang.perl Subject: Re: I'm lazy, can this be done somehow??? Message-ID: <1180012@hpcc01.HP.COM> Date: 31 Jan 91 19:25:03 GMT References: <1991Jan26.012646.4937@sdd.hp.com> Organization: HP Corp Computing & Services Lines: 28 Brandon S. Allbery writes: > | DB<4> $[=4; > > When did the values stop being restricted to 0 and 1? *This* is exactly what > I was asking for, myself. The manpage (actually the info file) says: $[ The index of the first element in an array, and of the first character in a substring. Default is 0, but you could set it to 1 to make *perl* behave more like `awk' (or Fortran) when subscripting and when evaluating the `index()' and `substr()' functions. (Mnemonic: `[' begins subscripts.) This mentions 0 and 1 as the two most noteworthy values, but doesn't really say that it is restricted to those values. If you were misled, then so have been others. Maybe a slight rewording would be helpful: $[ The index of the first element in an array, and of the first character in a substring. The value is an integer with default of 0. You could set it to 1 to make ... - Len Weisberg - HP Corp Computing & Services - weisberg@corp.HP.COM