Problem with subroutine Variable "$file" will not stay shared at..



Hello
I use this function with the subroutine match to find a file:

sub search{
my $file = shift;
use File::Find;
find {wanted => \&match, no_chdir => 1}, "/home";
sub match {
return $_ if /$file/;
}
}

The problem I have is with the inner subroutine. I dont know how i can
get rid of the warning Variable "$file" will not stay shared at. I dont
want to change it i just want to compare it?

thank you

.