in reply to Use of uninitialized value $_ in pattern match (m//)?

The problem is that you have not set $_ anywhere either explicitly or implicitly. From your description it looks like you want to match against a filename so perhaps it is glob that you really want rather than m//?