in reply to prompting a user for input

Personally, I like to do something like this:
if ($answer =~ /^y/i) { unlink $file or die $!; } else { next; }
So, the user can type "Y", "yessir", "yep", or anything that starts with y. If it doesn't start with y, they mean no.

If you want something more exact, then Anarion gave you the perfect regexp above.