in reply to changing value to ones on array

Use a hash. You want to use a hash here, instead of similarly named variables.
for ("john", "jacob", "jingleheimer") { $total{$_} = ...; }
Now you'll have a hash, %total, whose keys are "john", "jacob", and "jingleheimer".

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;