in reply to Re: 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

I have never used perl before and I am only on the third chapter of the book so I had not known about the watch function.

Thank you for taking the time to provide a link to the documentation for me.

  • Comment on Re^2: Learning Perl - Question About Using a For Loop To Pull Data From an Array

Replies are listed 'Best First'.
Re^3: Learning Perl - Question About Using a For Loop To Pull Data From an Array
by Marshall (Canon) on Apr 01, 2016 at 20:52 UTC
    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.