i have used $need = param('dif') - $score.
i didin't know i could use params in a calc like that. problem solved, cheers On Monday 25 Mar 2002 6:38 pm, Dave Storrs wrote: > Hi Matthew, > > First of all, subtracting scalars is perfectly valid, so the actual error > must be something else. Here are three things you should check. > > 1) First, you don't have a semicolon at the end of that line. > > 2) Second, if you are operating under 'use strict', you will need to > predeclare your variables before using them so, (assuming that $dif and > $score were declared elsewhere): my $need = $dif - score; > > 3) A "500 server error" implies that you are writing a CGI. I can't tell > based on what you've said, but I think the most likely thing that is > happening here is that, somehow, what you are generating invalid HTML and > your web server is spitting up on the results...in other words, this is a > CGI error, not actually an arithmetic error. > > HTH, > > Dave > > On Sun, 24 Mar 2002, Matthew Harrison wrote: > > I have two scalars created from passed params. i want to create a third > > variable by subtracting the two scalars. how can i do this? i have > > tried: > > > > $need = $dif - $score > > > > but i get a 500 server error and my error log says that i cannot use > > the '-' operator on a scalar variable. can anyone suggesta better way? > > > > cheers > > > > -- > > Matthew Harrison > > Internet/Network Services Administrator > > Peanut-Butter Cheesecake Hosting Services > > Genstate > > www.peanutbuttercheesecake.co.uk -- Matthew Harrison Internet/Network Services Administrator Peanut-Butter Cheesecake Hosting Services Genstate www.peanutbuttercheesecake.co.uk -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]