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 .