my @numeric_string = split//, '0010030511'; my $first_three_digits = join '', splice @numeric_string, 0, 3;