in reply to List drives in linux using Perl

A word of caution on using fdisk -l, until recently, if you use LVM2, fdisk would report all the /dev/mapper names as well as the "dm-1, dm-2...dm-N" names, so you would need to remove the redundancies. This is fixed in util-linux 2.21.1 or so but your probably don't have a recent version like that unless you're on Arch Linux.

Myself, I'd probably start with /proc/diskstats and then, perhaps, I'd dig into /sys/block for more details.