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}

In reply to Re: Question On Forms and MS Word by shmem
in thread Question On Forms and MS Word by njweatherman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.