proper perl parsing to output values to variables