Perl is generally the best bet for these kinds of things..
Is there any particular reason you would like to use it? There are some great log packages out there... These can do much more than you could easily write with
PHP
Awstats (my favourite)..and available for
IIS
Webalizer