find and perl

I am using find2perl for finding files with no UIDs.

#! /usr/opt/perl5/bin/perl -w
eval 'exec /usr/opt/perl5/bin/perl -S $0 ${1+"$@"}'
if 0; #$running_under_some_shell

use strict;
use File::Find ();

# Set the variable $File::Find::dont_use_nlink if you're using AFS,
# since AFS cheats.

# for the convenience of &wanted calls, including -eval statements:
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
*prune = *File::Find::prune;

sub wanted;

my (%uid, %user);
while (my ($name, $pw, $uid) = getpwent) {
$uid{$name} = $uid{$uid} = $uid;

# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, '/');

sub wanted {
my ($dev,$ino,$mode,$nlink,$uid,$gid);

(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
($dev >= 0)
($dev >= 0)
) &&
!exists $uid{$uid} &&

Can someone help in fixing the following errors.
Use of uninitialized value in numeric ge (>=) at ./ line 35.
Use of uninitialized value in exists at ./ line 35.

Also I would like to exclude proc from the search.

Who is Participating?
ozoConnect With a Mentor Commented:

(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
($dev >= 0)
!exists $uid{$uid} &&
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.