I've written the following - haven't yet seen Google approve of it's output so it could have a bug, but still may be a place to start: ((From http://groups.google.com/group/google-sitemaps/browse_thread/thread/83b34a59a05a104d/56ba5f933c7bdb70?q=perl&rnum=2 )) If it prints anything on the screen you have a potentially bad filename and you'll need to add encoding code for it.. or skip it, or remove it.. #!/usr/bin/perl my $sitepath="/yourhtdocs"; my $website="http://yoursite.com"; chdir($sitepath); @stuff=`find . -type f -name "*.html"`; open(O,">sitemap"); print O < EOF foreach (@stuff) { chomp; $badone=$_; $badone =~ tr/-_.\/a-zA-Z0-9//cd; print if ($badone ne $_); s/^..//; $rfile="$sitepath/$_"; ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks)=stat $rfile; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($mtime); $year +=1900; $mon++; $mod=sprintf("%0.4d-%0.2d-%0.2dT%0.2d:%0.2d:%0.2d+00:00",$year,$mon,$mday,$hour,$min,$sec); $mod=sprintf("%0.4d-%0.2d-%0.2d",$year,$mon,$mday); $freq="monthly"; $freq="daily" if /index.html/; $priority="0.5"; $priority="0.7" if /index.html/; $priority="0.9" if /\/index.html/; print O < $website/$_ $mod $freq $priority EOF } print O < EOF close O; unlink("sitemap.gz"); system("gzip sitemap");