http://www.perlmonks.org?node_id=971610


in reply to List drives in linux using Perl

You can use strace to see what fdisk does under the hood and then reimplement it in Perl

...or just read fdisk source code!