SPUG:Best One-Liners and Scripts for UNIX

Creede Lambard creede at penguinsinthenight.com
Fri Apr 18 12:27:56 CDT 2003


From what little Basic I can remember, it's one based. However in Visual
Basic at least you can use the OPTION BASE keyword to change the "start"
of the array if you have a particular reason for doing so.

On Fri, 2003-04-18 at 10:05, 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
-- 
Creede Lambard <creede at penguinsinthenight.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.pm.org/pipermail/spug-list/attachments/20030418/e36bf01a/attachment.bin


More information about the spug-list mailing list