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):
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).use strict; use warnings;
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |