• "But even with this, do you really want to search all subdirectories of /tmp/dir1 with find()? "
    - Well, (he says hesitatingly) I think I do. What I do in my real script is have a hash tied to a part of the regex ($target in this script) that gets me closer to where I want to look($location) for the regex filename. Even then it has to search through several hundreds of files before finding the right one. When it finds the right file it captures the name and path for later use. Are you thinking I'm not using find() correctly?
  • "Or is -f "$location/target" what you want?"
    - I know for sure I don't want to include the $location in the $target on my command line. Part of my reason for using find() is to be able to find the path for me by descending in to directories. So my command line would be something like
    $ script.pl -f test.txt
    and the end result is where in the directory structure test.txt is located.
  • "Is "$target" supposed to be a regular expression?"
    - It's a regex.
  • "Or just the file basename (in which case you would want "if $_ eq $target" in the function)?"

  • In reply to Re^2: Adding a dispatch table and getting "Variable $x will not stay shared" errors. by gctaylor1
    in thread Adding a dispatch table and getting "Variable $x will not stay shared" errors. by gctaylor1

    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! —
    • How do I compose an effective node title?
    • How do I post a question effectively?
    • Markup in the Monastery
  • 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.