I am trying to get this work but i somehow get the below error, your help will be appreciated.
#!/usr/bin/perl
use strict;
use warnings;
my ($fred, $barney);
sub max {
print "You are using the subroutine max";
if ( $fred gt $barney ) {
$fred;
} else {
$barney;
}
}
my $n = &max(10, 15);
print "$n";
the error i get is
Use of uninitialized value in string gt at learningperl4.pl line 10.
Use of uninitialized value in string gt at learningperl4.pl line 10.
Use of uninitialized value in string at learningperl4.pl line 18.