print "Delete this file?[n]: "; chomp(my $answer=); if ($answer=~/^y|yes$/i){ unlink $file or die $!; } elsif ($answer=~/^n|no|$/i){ next; } else { ..... #### prompt? accept: y,n,yes,no default: to one of the above continue with program flow