On Aug 15, Scott R. Godin said:
Jeff 'japhy' Pinyan wrote:
Oh, Jolly Good! though I'm somewhat concerned with how much memory that would
take up. Ultimately this would be running as a cgi processing a web-form
submission.
Unless you're dealing with thousands of elements in your array, I wouldn't
expect a noticeable effect.
Then you would simply poll @discount to find out the rate; this is assuming
$quantity is some positive number:
my $rate = ($discount[$quantity] || $discount[-1]) / 100;
almost. when $discount[1] = 0 that makes it assume the 55% discount instead.
see below.
Oh, right, my bad.
--
Jeff "japhy" Pinyan % How can we ever be the sold short or
RPI Acacia Brother #734 % the cheated, we who for every service
http://japhy.perlmonk.org/ % have long ago been overpaid?
http://www.perlmonks.org/ % -- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>