Re: Array Question (Learning Perl/Win32 Chapter Test Question)

2003-06-21 Thread R. Joseph Newton
Anthony Beaman wrote: > Ahh...that's it! I didn't realize that. Now it makes sense! Thanks for clearing > this up! Any other advice on getting through this book? Thanks again! For right now, let this concept absorb deeply.Understanding the cardinal/ordinal numbering systems and how they int

RE: Array Question (Learning Perl/Win32 Chapter Test Question)

2003-06-20 Thread Anthony Beaman
Sent: Friday, June 20, 2003 1:56 PM To: Anthony Beaman Cc: Jenda Krynicky; [EMAIL PROTECTED] Subject: RE: Array Question (Learning Perl/Win32 Chapter Test Question) On Jun 20, Anthony Beaman said:

Re: Array Question (Learning Perl/Win32 Chapter Test Question)

2003-06-20 Thread John W. Krahn
Anthony Beaman wrote: > > But what's the "-1" for? Why not just "$b[$a]" instead? That's what I'm confused > about. Suppose that you want the first line so you enter "1". Because indexing starts at zero using $b[$a] will print out the second line. If you enter "4" for the fourth line $b[$a] wi

RE: Array Question (Learning Perl/Win32 Chapter Test Question)

2003-06-20 Thread Jeff 'japhy' Pinyan
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. Therefor

RE: Array Question (Learning Perl/Win32 Chapter Test Question)

2003-06-20 Thread Anthony Beaman
To: [EMAIL PROTECTED] Subject: Re: Array Question (Learning Perl/Win32 Chapter Test Question) From: "Anthony Beaman" <[EMAIL PROTECTED]> > 2. Write a program that reads a number and then a list of strings (all

Re: Array Question (Learning Perl/Win32 Chapter Test Question)

2003-06-20 Thread Jenda Krynicky
From: "Anthony Beaman" <[EMAIL PROTECTED]> > 2. Write a program that reads a number and then a list of strings (all > on separate lines), and then prints one of the lines from the list as > selected by the number. > > One way to do this is: > print "Enter the line number: "; chomp($a = ); > print

Array Question (Learning Perl/Win32 Chapter Test Question)

2003-06-20 Thread Anthony Beaman
Hi! Arrays are confusing me and I don't know why. I feel that I understand it but the test questions in Learning Perl for Win32 is tripping me up. For example, here's #2 below with the answer and explanation: 2. Write a program that reads a number and then a list of strings (all on separate lin