in reply to uninitialized value in numeric gt (>) in perl

It would seem this has to be $max_nb, since $total is initialized to 0. Ie, Octopussy::Parameter('wizard_max_msgs') is returning undef.

You could check that by throwing in something:

my $max_nb = Octopussy::Parameter('wizard_max_msgs'); die "$max_nb undefined!" unless (defined $max_nb);

Replies are listed 'Best First'.
Re^2: uninitialized value in numeric gt (>) in perl
by Utilitarian (Vicar) on Feb 23, 2011 at 14:36 UTC
    While I agree with halfcountplus, I would note that you could perform a simple or else set $max_nb to zero as follows
    my $max_nb = (Octopussy::Parameter('wizard_max_msgs'))||0;
    That said, the Octopussy::Parameter('wizard_max_msgs') should probably return zero if no such parameter.

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."