use Win32API::File qw (:Func );
my ( $sRootPath, $osVolName, $lVolName, $ouSerialNum, $ouMaxNameLen, $ouFsFlags, $osFsType, $lFsType );
$sRootPath = "C:/";
GetVolumeInformation( $sRootPath, $osVolName, $lVolName, $ouSerialNum, $ouMaxNameLen, $ouFsFlags, $osFsType, $lFsType );
#----
print "\nRoot:\t$sRootPath\n";
print "VolName:\t$osVolName\n";
print "SerialNumber:\t$ouSerialNum\n";
printf "Hex SerialNumber:\t%x\n", $ouSerialNum;
####
Root: C:/
VolName: mecano
SerialNumber: 2226596281
Hex SerialNumber: 84b729b9
####
>vol c:
Volume in drive C is mecano
Volume Serial Number is 84B7-29B9