Nectyr has asked for the wisdom of the Perl Monks concerning the following question:

I am using a web form to post a record into a perl script which in turn writes it to a DBM database. But it seems that whenever you put a : (colon) into one of the fields in the web form it makes the record in the database jump to the next field.

i.e.
field 1: NAME
field 2: MY NAME IS: jojo
field 3: PHONE NUMBER


the results in the database would be

field 1: NAME
field 2: MY NAME IS
field 3: jojo

I know this is probably pretty simple but I'm a newbie & Stuck! Thanks in advance for the explanation / solution.

Replies are listed 'Best First'.
Re: Why do my :'s freak my Script?
by fundflow (Chaplain) on Jul 24, 2000 at 19:24 UTC
    Why doesn't the following work for you?

    ($name, $value)=/^([^:]*):(.*)/;

    Are you reading the whole file into a scalar and then using split() ?

    If i'm way off, maybe put the code snippet so we can check it out.
(jeffa) Re: Why do my :'s freak my Script?
by jeffa (Bishop) on Jul 24, 2000 at 19:07 UTC
    Since I can't see the code that actually parses your data file, this will be a long shot. You have rows 1 and 3 containing one field, but row 2 contains 2 fields. Maybe you should try a data file like so:
    NAME: MY NAME IS:jojo PHONE NUMBER:
    If you are splitting on colons, you will get null values for the second field in rows 1 and 3. Hope this helps.

    Jeff

RE: Why do my :'s freak my Script?
by young perlhopper (Scribe) on Jul 24, 2000 at 19:44 UTC
    Please show us some code! we want to help! If you can isolate the smallest section of code that reproduces the error, it will help us help you faster :-)

    Thanks,
    Mark