I get the usual warning "Use of uninitialized ." while trying to test a
variable ($counter) which is initialized later in my script. Using the
pragma use vars ($counter) makes it sticky. To avoid, I tried to work
around it by passing it to a sub. 
 
 
 
 
my $counter = counter(); 
 
if ($counter == 0){
            do this.
 
}else { do that.}
 
 
my $rows = 0;
 
while (@data = $sth->fetchrow_array){
            $rows++;
 
 
}
 
counter($rows);
 
sub counter {
            return (my $x ) = shift;
 
}
 
I don't think it takes that much coding to get a variable across,
besides - it isn't working ok.
How can I best solve this?
 
 
Babs
 
 
 

Reply via email to