use Win32::OLE::Const "Microsoft Office .* Object Library"; # Close document $Doc->Close(); undef $Doc; # Close MS Word $Word->Quit(); undef $Word;