in reply to Re^2: Learning Perl - Question About Using a For Loop To Pull Data From an Array
in thread Learning Perl - Question About Using a For Loop To Pull Data From an Array

This book is highly, very highly suspect if it presents code like this as examples!

Print is your main friend. I very seldom use the debugger, even when developing C code. The debugger is yet another thing to learn at this early stage. I recommend getting good at writing print statements. Look at the difference say between: print "@names\n"; and print @names;.

As another tip for you, add the statement use warnings as the second line in the code. Run the code using some bogus input number like 99, both with and without this statement. In one case, you just get a blank output and in the other you get a run time warning that something went wrong and a clue to what line did it!

I don't want to overwhelm you with advice, please keep experimenting! You are going GREAT so far.