Pattern matching for file

Hi All,

I'm new to perl,
My requirement is to check if particular file exists.
e.g. filename.txt, filename1.txt, filename2.txt etc

I tried the below code:-

my $var1 = "filename.txt"

if ( -e ($var1 = ~ /file\w/))
{
print "File found \n";
}
else
{ print "File not found \n";
}

I'm getting o/p as �File not found� :confused:, please let me know what is wrong in my code.

Thanks in Adv.