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). | [reply] [d/l] [select] |
Thanks (once more) for the reply.
Turns out I was not in the directory I expected. In fact, I was not in A directory. Turns out the "\\" (DOS backslash) was not being interpreted. When I changed them to single forward slashes (UNIX), all ran as expected.
Odd thing though:
I'm running on Win2000.
I'll go back and read some more documentation/materials on Perl.
Thank you for all your replies!
| [reply] |
| [reply] |