in reply to Variable being saved as a list?

There seems to be nothing in that piece of code that obviously relates to the problem you describe. Also you haven't told us the name of the variable you have a problem with, the name of the variable that works, and what values they're supposed to contain vs. what they actually contain. Could you post the code that shows how those variables are set and used?

Another thing that would help both us and you in debugging is if you can reduce the code with the problem down to a small, self-contained example that reproduces the problem.

More tips in How do I post a question effectively?

Replies are listed 'Best First'.
Re^2: Variable being saved as a list?
by fiona (Initiate) on Aug 06, 2014 at 18:57 UTC
    Sorry, as I said I am new to this. The variable I am having a problem with is $shipcountry, the variable $discnt works fine. I am trying to update $shipcountry via a form. It starts as "none" and I want it to change to whatever country is entered but what I end up with is, for example, "none, United States, Canada, United States" the number in the list depends on how many times you try and submit a change. I am not sure how I can make a self contained example but I will try.
      Sorry, as I said I am new to this.

      No problem, we're here to help. Pages such as "How do I post a question effectively?" are there to help people asking questions help the people answering them (despite their sometimes slightly patronizing titles).

      I suspect the problem actually lies with the code that sets $shipcountry in your script. Are you using some kind of library to handle the input from the form? If so, I'd also look there for how it handles $shipcountry and why it might be appending the values.

      A note on terminology for the future: A "list" in Perl is actually not what you've got with $shipcountry, that's a scalar (a single value) that contains a string (which happens to contain commas).

        Thanks, I managed to get it working, there was some code at the bottom of the script that was causing it to do funny things with variables it didn't recognize. Thanks for the help.