SPUG:Best One-Liners and Scripts for UNIX

Terry Nightingale tnight at pobox.com
Fri Apr 18 12:13:32 CDT 2003


BASIC and its progeny (Business BASIC, VB, VBA, VBScript, etc.) are also 
one-based.  JavaScript, however, is zero-based like Java.  Go figure.


Brian Hatch wrote:

> 
>>>>unshift @F, "(No zeroth field! first is #1)";
>>>
>>>Are you nuts?  That was the whole point of using perl!  Of course
>>>the first field should be field #0.  Anything else is unperlish.
>>
>>Huh???
> 
> 
> Out of curiousity, what languages are zero based vs one based?
> Perl is zero based (unless you use '$[ = 1')
> 
> Zero based:
> 	C, C++, Perl, Python[1] ...
> 
> One based:
> 	Fortran, awk, Perl[2]
> 
> 
> [1] IIRC
> 
> [2] If you use '$[ = 1', but don't do that.
> 
> 
> 
> --
> Brian Hatch                  Never take life seriously.
>    Systems and                Nobody gets out alive,
>    Security Engineer          anyway.
> http://www.ifokr.org/bri/
> 
> Every message PGP signed

-- 
Terry Nightingale <tnight at pobox.com>
Web Developer, Philosopher, Geek
"In theory, there is no difference between theory and practice. But, in
practice, there is." -- Jan L.A. van de Snepscheut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3411 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.pm.org/pipermail/spug-list/attachments/20030418/fa906772/smime.bin


More information about the spug-list mailing list