# $input is received from a web submission, # assigned a value here for simplification $input = '9525423E'; @digits = split //, $input; my $letter = uc(pop @digits);