my $answer = ; my $first_char = substr $answer, 0, 1; if ( lc $first_char eq 'y' ) { # they answered 'yes' } else { # they answered something else }