in reply to how to make wildcard work in if (-e *..)

Wildcards won't work with the filetest operator. Try readdir and grep, ie:
opendir DIR, '.' or die "Error: $!"; my @files = grep { /\.txt$/ } readdir DIR;
will find *.txt in the current directory.