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

Remove the "\n" when you read the records in
while(<VOTE>){ chomp ; # add ($user[$count],$vote[$count])=split (/\|/); $count++ }
poj

Replies are listed 'Best First'.
Re^4: incrementing array variables in a text file?
by friar tux (Novice) on May 01, 2011 at 17:11 UTC

    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>

      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