guess my only remaining issue would be with the $Variable = <EXPR> syntax.

$Variable, when tested, is always null. I would think that by setting it equal to <EXPR>, it would take on the value of the file name. Correct?

In that case, EXPR is probably being interpreted as a filehandle (there are rules whether it calls glob() or readline(), check perlop), so you might be reading an unopened filehandle (or there's no lines in the file or you're calling glob and returning no file names), and you would get a warning to that effect (about unopened filehandles, that is) if you put this at the top of every script you write (and it's good habit, though don't just blindly do it on critical production scripts that don't have it yet, it'll most likely break'em):

use strict; use warnings;
If the scripts you are using don't have this, then I'd suspect the quality of them (or the age of them if you're still using Perl 4).
How do I test or display the contents of $Variable after it changes within the function? (Does that make sense the way I worded it?)
I'm not sure what you mean...you can print "$Variable\n"; Do you mean something else?

Documentation for all these functions should already be installed on any system that perl is installed on. (with "perldoc" at the command line and/or html docs under the Perl directory if ActiveState perl is installed).

Update: I'm thinking I may have misinterpreted that first question. In the while loop (in the original post), if $Variable is undefined, then I would temporarily add a print "$Path{Directory}\\*$FileExtension\n"; to see what pattern is being matched (maybe it's not what you expect), and/or maybe a use Cwd; print cwd(),"\n"; (maybe you're not in the directory you think you are).


In reply to Re^3: When is defined true? by runrig
in thread When is defined true? by LazrD

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.