#!C:/ActivePerl/bin/perl.exe -w use strict; use Win32::OLE; my $word_app = Win32::OLE->new("Word.Application") or die ("Didn't create Word App.\n"); my $file="F:/test.doc"; my $word_file = $word_app->Documents->Open($file) or die ("Didn't manage to create a document object.\n"); print "File $file has " . $word_file->Words->Count . " words in it.\n"; $word_file->Close(0); #SaveChanges:=False $word_app->Quit; #SaveChanges not needed as files closed.