Use it in scalar context:

my $num_elements = @drives;

-Robin

> -----Original Message-----
> From: Jorge Goncalvez [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, July 05, 2001 8:14 AM
> To:   [EMAIL PROTECTED]
> Subject:      Re:number of records
> 
> I have the following :
> 
> @drives = Win32::DriveInfo::DrivesInUse();
> 
> How can I get the number of element in the array @drives?
> 
> $cc2-> checkbutton (-label=>$drives[0], -variable => \$A);
> $cc2-> checkbutton (-label=>$drives[1], -variable => \$B);
> $cc2-> checkbutton (-label=>$drives[2], -variable => \$C);
> $cc2-> checkbutton (-label=>$drives[3], -variable => \$D);
> $cc2-> checkbutton (-label=>$drives[4], -variable => \$E);
> $cc2-> checkbutton (-label=>$drives[5], -variable => \$F);
> $cc2-> checkbutton (-label=>$drives[6], -variable => \$G);
> $cc2-> checkbutton (-label=>$drives[7], -variable => \$H);
> $cc2-> checkbutton (-label=>$drives[8], -variable => \$I);
> 
> 
> 
> to simplify this code .

Reply via email to