Code snippet at the end of my little script:
<more code>
...
my $count;
foreach my $email (@emails){
print $email, "\n";
$count += 1;
};
if ($count > 0){
print "\n" . "count = " . $count . "\n";
}
else{
print "count = 0";
};
exit;
I've declared $count globally so I can use it in more than one block of code.
However, when I execute this I get an error saying "Use of uninitialized value
in numeric gt (>) at ./check_spam_users.pl line 59." Line 59 being the if
($count > 0) line.
If I declared it outside of the scope of any block of code shouldn't it be
available in any block of code?
Mathew
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>