> Here is the orignal:
> $sc_sales_tax = ".0775";
> @sc_sales_tax_form_values = ("ca", "Calafornia");
>
> And here is what I am trying to do:
>   @$sc_sales_tax = (".00",
>       [snip] );
>   @sc_sales_tax_form_values = ("Outside CA",
>       [snip] );


Jack mentioned the typo with the additional scalar specifier, but even
if you correct that, your values for the two variables will be different,
and this sample doesn't show what the rest of the script does with those
values.

personally, i'd suggest adding a new hash and using a couple of
intermediate variables, rather than redefining the structures of the
variables that already exist:

    %location_hash = (
        "Outside CA"    => ".0000,other",
        "Alameda"       => ".0825,ca",
        "Alpine"        => ".0725,ca",
        "Amador"        => ".0725,ca",
        "Butte"         => ".0725,ca",
        "Calaveras"     => ".0725,ca",
        "Colusa"        => ".0725,ca",
        "Contra Costa"  => ".0825,ca",
        "Del Norte"     => ".0725,ca",
        "El Dorado"     => ".0725,ca",
        "Fresno"        => ".0725,ca",
    );

    ($tax, $loc) = split (',', $location_hash{ $location_spec } );

    $sc_sales_tax = $tax;
    @sc_sales_tax_form_values = ($loc, $location_spec);



that will keep the data structures from the original script in exactly
the same form the were before.   it eliminates the chance of problems
cropping up in other parts of the code because of the change, and makes
life just a bit more worth living.   the hash structure also makes it a
tad easier to keep track of which counties have what taxes, makes adding
& removing counties easier, blah, blah, blah..

even without knowing about the rest of the script, it would seem fairly
straightforward to create a new <SELECT> item in the web form that
identifies the county, use that as your $location_spec value, and then
plug the calculated values into the expected places, as above.







mike stone  <[EMAIL PROTECTED]>   'net geek..
been there, done that,  have network, will travel.



____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to