Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: array processing

by tirwhan (Abbot)
on Dec 06, 2005 at 12:58 UTC ( [id://514427]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://514427]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-23 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found