in reply to Re: Re: Execute error on opendir
in thread Execute error on opendir

It's always safest(not sure if it's required) to give opendir an absolute directory name - that is, a directory name with a fully qualified path. Do the "element"s in /Scripts/rotlog have absolute directory names in them?

And, the $name that readdir returns is *NOT* an absolute filename. Therefore, before you try to test $name with a -M filetest operator, you must provide the absolute path to $name - something like this:
my $current_abs_dir = "/path/to/opendir/directory"; while ($name = readdir(REP)) { $abs_name = "$current_abs_dir/$name"; if (-M $abs_name >= 10) {
If the elements in /Scripts/rotlog do not include the absolute path to the directory, you'll need to get the absolute path to the directory from somewhere.

Read the perldocs for opendir and readdir by doing
perldoc -f opendir perldoc -f readdir
HTH.

Replies are listed 'Best First'.
Re: Re: Re: Re: Execute error on opendir
by mikevanhoff (Acolyte) on Aug 14, 2002 at 14:48 UTC
    Thanks, and yes the lines in /Scripts/rotlog are absolute paths. I want to read the contents of the dir in each line (path) of the /Scripts/rotlog file into the array. The issue is using the array elements instead of hard coding the paths.