WWW::DoctypeGrabber is a Perl module that can be used to grab doctypes from webpages.
my $grabber = WWW::DoctypeGrabber->new;
my $res_ref = $grabber->grab('http://zoffix.com/')
or die "Error: " . $grabber->error;
print "Results: $grabbern";
The module was developed to be used in an IRC bot and probably will be useless for anything else. If your intent is to parse some doctypes of HTML documents for validness etc. you are probably better off using some other module.
The module accesses a given URI and checks if the page has doctype, what kind of doctype, whether or not there are any (non-)whitespace characters in front of the doctype, whether or not there is an XML prolog and whether or not the DTD URI matches the ones provided by W3C.