in reply to Re: Test to see if directories are the same
in thread Test to see if directories are the same
Don't write the same code twice. Ever. :)-d $s and $s = abs_path($s) or return -1 ; -d $d and $d = abs_path($d) or return -1 ;
Except that's using "foo AND bar OR bletch" where it should be using "foo ? bar : bletch", so I'd tighten that up to:-d $_ and $_ = abs_path($_) or return -1 for $s, $d;
(-d $_) ? ($_ = abs_path($_)) : (return -1) for $s, $d;
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Test to see if directories are the same
by AltBlue (Chaplain) on Jan 18, 2001 at 15:44 UTC |