I haven't used Perl in a long time but I'm working on a CGI script. It works perfectly but will give me a server error if I try to divide!
ex.
$num = 50;
print "$num";
This works fine ... but if I do this:
$num = 10/50;
print "$num";
I get an error ... I have no clue how to solve this!
The program returns syntax errors from a subroutine using a switch statement which is called just before the division. The subroutine is fine though, it gives me correct data as long as I don't divide numbers it produces.
I finally got it to work by executing the code outside of the subroutine. This makes no sense to me at all, it shouldn't have given me syntax errors if it works outside of the subroutine.
ex.
$num = 50;
print "$num";
This works fine ... but if I do this:
$num = 10/50;
print "$num";
I get an error ... I have no clue how to solve this!
The program returns syntax errors from a subroutine using a switch statement which is called just before the division. The subroutine is fine though, it gives me correct data as long as I don't divide numbers it produces.
I finally got it to work by executing the code outside of the subroutine. This makes no sense to me at all, it shouldn't have given me syntax errors if it works outside of the subroutine.