#!D:/perl/perl/bin/perl.exe
# Script name = exercisechap2.pl
use strict;
use warnings;
use diagnostics;
use CGI::Carp 'fatalsToBrowser';
use CGI qw(-debug);
print "Content-type: text/html\n\n";
my $number1 = 50;
my $number2 = 80;
if ($number1 > $number2)
{print $number1 is greater than $number2}
else
{print $number2 is greater than $number1}
Hello, above is the script I am using to get the largest number between $number1, and $number2. Can someone tell me why I get this error below? I am using 80 as a number with no single or double quotes, but error still says that it is a string, why?
##########
Software error:
Can't use string ("80") as a symbol ref while "strict refs" in use at D:/wamp/www/perl/exercisechap2.pl line 18.
##########
Thanks!