In article <5.1.0.14.0.20010702140058.01b6c9c0@exchi01>, "Craig A. Berry" <craigberry@mac.com> writes: > The existing logic in openunicode() bails out if it fails to open the first > filespec it tries. I believe the intent is to iterate through @INC until it > successfully finds and opens the file or exhausts the list. > > --- lib/Unicode/UCD.pm;-0 Sun Jul 1 01:56:14 2001 > +++ lib/Unicode/UCD.pm Mon Jul 2 14:49:25 2001 > @@ -44,6 +44,7 @@ > for my $d (@INC) { > use File::Spec; > $f = File::Spec->catfile($d, "unicode", @path); > + next unless -f $f; > if (open($$rfh, $f)) { > last; > } else { Strictly speaking that introduces a race. Normally it's better to check the open result against ENOENT, but the cost would be to have to load one of the Errno modules. Another way may be to do a next in the else branch always, but remember $! and report the last one on failure.Thread Previous | Thread Next