if ($answer=~/y/i){ my $first = "bar.txt"; Edit($first); } elsif ($answer =~/n/i){ exit }