use warnings;use strict;use Win32::OLE;use Win32::OLE::Const 'Microsoft Word';my$word= Win32::OLE->new('Word.Application','Quit');$word->Documents->Open("D:\\test.doc")||die("Unable to open document ", Win32::OLE->LastError());# $word->ActiveDocument-> ...$word->Quit;