M
Monty
I'm using the File::Find module to search through a directory tree and
perform operations on files with a .hdr suffix for the file name. I
have a test environment set up and known defects in the files, but I
get an error I hadn't expected with the find() function. The set up
is like this:
use File::Find;
find (\&process_file,".");
sub process_file {
if (/\.hdr/) {
print "$File::Find::name\n";
open HDR_FILE, "<$File::Find::name" or die "Can't open file
for input: $!\n";
...etc.
It prints the correct file name, complete with relative path, but it
dies on the open statement every time. What am I doing wrong?
Thanks in advance.
perform operations on files with a .hdr suffix for the file name. I
have a test environment set up and known defects in the files, but I
get an error I hadn't expected with the find() function. The set up
is like this:
use File::Find;
find (\&process_file,".");
sub process_file {
if (/\.hdr/) {
print "$File::Find::name\n";
open HDR_FILE, "<$File::Find::name" or die "Can't open file
for input: $!\n";
...etc.
It prints the correct file name, complete with relative path, but it
dies on the open statement every time. What am I doing wrong?
Thanks in advance.