Why are you reading a list of file names from an "rtf" file? I would assume that this text-processing-based file format is not really suitable as input to the kind of procedure you're trying to set up here, because the file is likely to contain a strange assortment of formatting directives in addition to the data you actually need.

It would be much better if you can supply an unadorned plain-text "flat list" (e.g. as produced by the unix/linux "ls" or "find" utilities), or better yet, use opendir and readdir (or File::Find) to pull file names directly from the source folder(s) where your pdf files are stored.

As it is, the OP code is being pretty promiscuous about the accepting the contents of "ad_archive.rtf", and assuming that all those ".*" patterns in the regexes will yield sensible matches. I would expect a lot of failures.


In reply to Re: finding odd characters in a string that I am creating in the script by graff
in thread finding odd characters in a string that I am creating in the script by donkeykong

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.