print "do you want to remove tags Y/N \n"; chomp(my $ok = <>), my $yes = 'y'; my $no = 'n'; $inp = lc($ok); if ($inp eq $yes){ print "removed "; } elsif ($inp eq $no) { print "not removed "; }