I am new to perl and am having issues with this script i am using for a syslog server. I am not getting any responses from the original developer and as such bringin my issue to the perl gods for help.

I receive the following error when my program runs:

 Use of uninitialized value in numeric gt (>) at....at line 537.

the line in question is:

return ($total) if ($total > $max_nb)

the function this belongs to is:

sub Unknown_Number { my $device = shift; my $max_nb = Octopussy::Parameter('wizard_max_msgs'); my ($total, $nb) = (0, 0); my $dir = Octopussy::Storage::Directory_Unknown($device); Octopussy::FS::Create_Directory("$dir/$device/Unknown/"); foreach my $fy (glob "$dir/$device/Unknown/*") { foreach my $fm (glob "$fy/*") { foreach my $fd (glob "$fm/*") { foreach my $f (glob "$fd/*") { chomp $f; $nb = `zcat "$f" | wc -l`; chomp $nb; $total += $nb if ($nb >= 0); return ($total) if ($total > $max_nb); } } } } return ($total); }

sorry this may seem long. Any help on this would be greatly appreciated.


In reply to uninitialized value in numeric gt (>) in perl by murphybr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.