On Jun 20, Anthony Beaman said:

>But what's the "-1" for? Why not just "$b[$a]" instead? That's what I'm
>confused about.

Arrays start at 0.  Thus, the first element of an array is $array[0].

Line numbers (as far as human think of them) start at 1.  The first line
is considered line 1.  Therefore, humans are thinking +1 from what
computers are thinking.  To correct this, you subtract 1 from what the
human enters, and the computer does the right thing.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to