Changing a MOSS Publishing Welcome Page Programatically

For those of you looking to dynamically change the Welcome page for a MOSS Publishing site dynamically here you go:

Where "p" is the URL for the page you would like to change the welcome page to (i.e. "Pages/Home.aspx").  

static public void UpdateWelcomePage(SPWeb web, string p)

        {

            if (PublishingWeb.IsPublishingWeb(web))

            {

                PublishingWeb pw = PublishingWeb.GetPublishingWeb(web);

                PublishingSite site = new PublishingSite(web.Site);

                //Set the default page

                SPFile welcomefile = web.GetFile(p);

                pw.DefaultPage = welcomefile;

                pw.Update();

            }

        }

Note the SPWeb.GetFile() method also has an overload for the GUID of the page you would like to make the Welcome Page.