[ Michael S. James writes: ]
>
> [snip]
> undef $valid_dir;
> foreach $dir (@archive_dirs) {
> if ($dir eq $dirname) {
> $valid_dir = $dirname;
> last;
> }
> }
>
> if (!$valid_dir) {
> &abort("Invalid archive directory. Aborting. ($dir)=dir & \
> ^^^^^^^^^^^^
> ($dirname)=dirname\n");
> ^^^^^^^^^^^^^^^^^^
> [snip]
[...]
> Now my questions.
>
> 1. What is $dir supposed to be reading? I figure it's upposed to be
> reading a directory path because it's be compared to another directory path.
>
> 2. If it's supposed to be reading a directory path, how come it has no
> value or contents?
$dir has no value at the point you're dumping it because it's localized
for the 'foreach' loop and has no value outside that loop. Assign it to
a variable that is visible outside the loop and use that variable in the
abort message.
--
Dave Wolfe *Not a spokesman for Motorola*
Motorola MMTG 6501 Wm. Cannon Dr. W. OE112 Austin TX 78735-8598
Follow-Ups:
References:
|
|