in reply to Question On Forms and MS Word

The CGI program then takes those multiple selections, uses the split function @rename_file = split(/,/, $in{'clients'}); splits the data on the comma and then stores each selection into the array rename_file.

Are you sure this is what is happening? prove it with some code. You might have an anonymous array as value to that hash key, but then I don't know how you get $in{'clients'} in the first place.

Any answers as to why this happens?

It could be a parameter processing error as outlined above; it could be something else. Without code it's hard to tell.

I have no experience with MS Word encantations via perl, but it strikes me that you create a full application for each replacement. Why don't you just chain your replacements using a single Word instance?

my $word = Win32::OLE->new('Word.Application', 'Quit'); $word->Documents->Open("S:/Documents/CENTRAL NJ.doc") || die("Unable t +o open document ", Win32::OLE->LastError()); my $searchword = 'CENTRAL NJ'; foreach $file (@rename_file) { $word->Selection->Find->{'Text'} = $searchword; $word->Selection->Find->Replacement->{'Text'} = "$file"; $word->Selection->Find->Execute({Replace=>wdReplaceAll}); $word->ActiveDocument->SaveAs({FileName=>"S:/Documents/$file.doc"} +); $searchword = $file; # next pass, search this text. } $word->ActiveDocument->Close; $word->Quit;

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}