Portman wrote:
Ah. Got it to work. I change the if ($total < 50) { my $sandh=8;} to if ($total < 50) { $sandh=8;}

Go figure.


I have this code now:

my $sandh=5;

if ($total < 50) { my $sandh=8; }

my $shippingCharge=$shipcost{$selectedState}*$total+$sandh;

and the program seems to simply skip over the if statement. Any ideas?


It's a scope issue. By using 'my' inside the braces you create a new variable that only exists inside the braces.

--
Sheila
http://www.shefen.com/


____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: archive@jab.org
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to