develooper Front page | perl.perl5.porters | Postings from March 2001

File::Find, shortcircuiting && and undefined values

Hans Ecke
March 10, 2001 08:03
File::Find, shortcircuiting && and undefined values
Message ID:
Dear Mr. Sarathy,

in, which you authored, I get the following error:

warning: Use of uninitialized value in join at
/usr/lib/perl5/5.6.0/File/ line 261.

Line 261 of File::Find reads:
if ($full_check && $SLnkSeen{$DEV, $INO}++) {

It seems the join in this line comes from the {$DEV,$INO} which is
internally interpreted as a
join $separator, ($DEV,$INO)

Debugging the offending script showed the following:
   * $full_check is 1 (true)
   * both $DEV and $INO are undefined

Obviously this was not supposed to happen. I looked around at which file
this condition occured. It is
/home/commonground/apps/gtksql-0.3/COPYING. The permissions are as

/home/commonground/apps> ls -l
drwxrw----    4 root     commongr     4096 Jan 12 12:20 gtksql-0.3/

/home/commonground/apps/gtksql-0.3> ls -l
-rw-rw----    1 root     commongr    18007 Dec  4  1999 COPYING

I, the caller of the script, am a member of the group commongr, but am
not user root. I don't understand why an lstat(file) needs "x"
permission for the directory the files lives in,  but it seems the case.
After a "chmod g+x /home/commonground/apps/gtksql-0.3" everything works
just fine.

A fix is the following line at the top of FollowSymlinks() after the
    return $AbsName if (!defined $DEV) || (!defined $INO);

or just test for -x in _find_dir_symlnk().

I hope I made the problem clear. If not, please write.

I also hope this is not a known problem. I browsed through the mailing
lists but didn't see a reference. If I missed it, please accept my

I'm running perl 5.6 on i686 Redhat Linux 7.0.


Hans Ecke

"But I don't want to go among mad people," Alice remarked.
"Oh, you can't help that," said the cat. "We're all mad here."

Hans Ecke            
Department of Geophysics
Colorado School of Mines       Tel: (USA) 303-273-3733
Golden, Colorado               Fax: (USA) 303-384-2125 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About