use strict; my $string="AB123456789this_code_is_untested"; my $match=substr $string, 0, 11;