in reply to problem with variable values

Your problem is that the precedence of == (numeric equal) is higher than that of , (comma). This means that the numeric comparison happens before the call to index, so every one of your index calls is returning the position of 1 in the string (numeric comparison of any string with 0 yields true or 1), and unless the string actually contains 1, your if( index... lines will all return -1, which if interprets as true. Unfortunately if the string does contain 1, index will return the postion of the digit, which will also be seen as true by if unless the digit happens to be at position 0 (first in the string).

To make a long story short, all your data match all your conditionals and so all your variables are set to each line. Since your "gold" line is last in your data, all the variables have been set to that line by the time your script produces output. To change this, you can force the precedence you want using brackets in the appropriate locations.

All of that however is evading many handy Perl features. One easier way to do it which is still similar to yours would be to use perlfunc:split to extract your keywords and values from your data lines, along the lines of:

my($keyword,$value)= split ':', $line;

as the first line in your loop, then just test the possible values of $keyword. There are many "more Perlish" ways to do this, but this should suffice without getting you too confused for now.

Finally, you should always use strict, and check the return value when you open a file. I hope this helps!

--
I'd like to be able to assign to an luser