in reply to Re^3: incrementing array variables in a text file?
in thread incrementing array variables in a text file?

I tried the chomp and it didn't seem to work i also tried chop, is there anything else I need to add beside the chomp; to make it remove the "\n"? </code>

  • Comment on Re^4: incrementing array variables in a text file?

Replies are listed 'Best First'.
Re^5: incrementing array variables in a text file?
by poj (Abbot) on May 01, 2011 at 20:05 UTC
    It won't work if the vote.txt file already has extra newlines, try starting with a blank vote.txt file.
    If it still doesn't work try this instead of chomp
    s/[\r\n]//g;
    poj

      It worked!!! removing chomp and putting that in fixed the problem thank you so much. I am going to have to go look that up so I know how it works but at least now I can start practicing with a working script and I can start polishing it up. thanks for your help