in reply to Re^2: array processing
in thread array processing

You've got an error in testing for your $linenum. Also, you're incrementing your variable after you test and loop back, so it never gets incremented. Change

next unless ($linenum = $lastline);
to
next unless ($linenum++ >= $lastline);

Update: sorry, I didn't do this carefully enough, changed to work


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan

Replies are listed 'Best First'.
Re^4: array processing
by Anonymous Monk on Dec 06, 2005 at 13:12 UTC
    I must be doing something else wrong because it still doesn't work.
    I changed the line to
    next unless ($linenum < $lastline);
    because I want to process everything after the lastline. I still end up with linenum being set to 1 after the while loop has processed ?

Re^4: array processing
by Anonymous Monk on Dec 06, 2005 at 13:31 UTC
    Many thanks