SPUG:Best One-Liners and Scripts for UNIX

Brian Hatch spug at ifokr.org
Fri Apr 18 12:05:12 CDT 2003



> > > 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/spug-list/attachments/20030418/9980ab6a/attachment.bin


More information about the spug-list mailing list