#!/bin/perl5 use strict; use warnings; use Win32::OLE; my $w = Win32::OLE->GetActiveObject('Word.Application'); my $d = $w->ActiveDocument; my $paras = $d->Paragraphs; my @word; foreach my $para (in $paras) { my $text = $para->Range->{text}; chop $text; # remove /r push @word, $text; } print "$_\n" for @word;